index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317
  1. <template>
  2. <view class="app">
  3. <view class="app-top">
  4. <view class="atop1">
  5. <view class="top2-bg"></view>
  6. </view>
  7. <view class="atop2"></view>
  8. </view>
  9. <view class="top" id="mtop">
  10. <view class="top-body">
  11. <view class="statusBar" :style="'height:' + statusBarHeight + 'px'"></view>
  12. <view class="panel fx-r fx-bc fx-ac">
  13. <image src="/static/img/index-logo.png" mode="aspectFill" class="index-img"></image>
  14. <view class="fx-g1"></view>
  15. <image src="/static/img/ic_information.png" class="information"></image>
  16. </view>
  17. </view>
  18. </view>
  19. <scroll-view scroll-y :style="{height:'calc(100vh - 80rpx - ' + statusBarHeight + 'px - ' + h5Foot + 'px)'}">
  20. <view class="app-body">
  21. <view class="swiper-img">
  22. <u-swiper :list="topData.banner" keyName="img" bgColor="transparent" indicator
  23. indicatorActiveColor="#DB292B" indicatorInactiveColor="#B7B7B7" previousMargin="15"
  24. nextMargin="15" indicatorMode="line"></u-swiper>
  25. </view>
  26. <view class="grid-bg">
  27. <!--九宫格-->
  28. <view class="grid fx-r fx-bc fx-ac" v-if="sysData.is_audit == 0">
  29. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen2" data-url="/pages/user/order/index">
  30. <image class="icon" mode="aspectFill" src="/static/ad/1.png"></image>
  31. <view class="label">提货订单</view>
  32. </view>
  33. <view class="item fx-h fx-bc fx-ac" @tap="$refs.customer.open()">
  34. <image class="icon" mode="aspectFill" src="/static/ad/2.png"></image>
  35. <view class="label">联系客服</view>
  36. </view>
  37. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/merchant/list">
  38. <image class="icon" mode="aspectFill" src="/static/ad/3.png"></image>
  39. <view class="label">附近门店</view>
  40. </view>
  41. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen2" data-url="/pages/guild/order/order">
  42. <image class="icon" mode="aspectFill" src="/static/ad/4.png"></image>
  43. <view class="label">抢购订单</view>
  44. </view>
  45. <view class="item fx-h fx-bc fx-ac" @tap="tapOpen" data-url="/pages/news/about">
  46. <image class="icon" mode="aspectFill" src="/static/ad/5.png"></image>
  47. <view class="label">关于我们</view>
  48. </view>
  49. </view>
  50. <!--消息通知-->
  51. <view class="news-panel fx-r fx-bc" v-if="showData">
  52. <image src="/static/img/news-icon.png" class="icon"></image>
  53. <view class="label">消息通知</view>
  54. <view class="fx-g1" style="height: 30px;">
  55. <maoScroll :data="topData.notice" :showNum="1" :lineHeight="60" :animationScroll="800"
  56. :animation="4000">
  57. <template v-slot="{line}">
  58. <view @tap="tapOpen" :data-url="'../news/index?id=' + line.id" class="line">
  59. {{ line.title }}
  60. </view>
  61. </template>
  62. </maoScroll>
  63. </view>
  64. <image @tap="tapNews" src="/static/img/news-right.png" class="icon-right"></image>
  65. </view>
  66. </view>
  67. <view v-if="sysData.is_audit == 0">
  68. <!--CBB潮贝抢货通道-->
  69. <view class="team-buy" @tap="tapOpen" data-url="/pages/guild/itemIndex" v-if="guData!= null">
  70. <view class="top fx-r fx-bc">
  71. <view class="label">CBB潮贝抢货通道</view>
  72. <view class="fx-g1"></view>
  73. <!-- <view class="sbtn">更多CBB代理团队 ></view> -->
  74. </view>
  75. <view class="team-show">
  76. <view class="bg">
  77. <image src="../../static/ad/team-bg.png" mode="aspectFill"></image>
  78. <view class="h"></view>
  79. </view>
  80. <view class="body fx-h fx-bc fx-ac">
  81. <view class="top-input">
  82. <image src="/static/img/team-top-title.png" class="tbg"></image>
  83. <view class="inner fx-r fx-bc fx-ac">
  84. <image src="/static/img/team-top-location.png"></image>
  85. <view class="label">{{ guData.name }}</view>
  86. </view>
  87. </view>
  88. <view class="info fx-r fx-g1 fx-bc fx-ac">
  89. <view class="item fx-h fx-bc fx-ac">
  90. <view class="label" v-if="guData.status == 1">开放中</view>
  91. <view class="label" style="color: red;" v-else>闭馆中</view>
  92. <view class="name">状态</view>
  93. </view>
  94. <view class="halving"></view>
  95. <view class="item fx-h fx-bc fx-ac">
  96. <view class="label">{{ guData.nickname }}</view>
  97. <view class="name">部门总监</view>
  98. </view>
  99. <view class="halving"></view>
  100. <view class="item fx-h fx-bc fx-ac">
  101. <view class="people fx-r">
  102. <image
  103. :src="index == 0 ? '/static/img/hong_people.png' : '/static/img/while_people.png'"
  104. v-for="(item,index) in 5"></image>
  105. </view>
  106. <view class="name">流畅</view>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <!--文票系统-->
  113. <!-- <view class="tradeweb">
  114. <view class="bg">
  115. <image src="/static/img/wen_bg.png"></image>
  116. </view>
  117. <view class="ibody fx-h fx-bc">
  118. <view class="t1">{{ wenAr.fullname || "" }}</view>
  119. <view class="name">CBB文票系统</view>
  120. <view class="wname">价格(CNY):{{ wenAr.openPrice || "0.00" }}</view>
  121. </view>
  122. <view class="ivpop fx-h fx-bc fx-ac">
  123. <view class="lv">
  124. {{ wenAr.lv || '0' }}%
  125. </view>
  126. <view class="v">近24小时涨跌幅</view>
  127. </view>
  128. </view> -->
  129. </view>
  130. <!--提货好物-->
  131. <view class="goods">
  132. <view class="top fx-r fx-bc fx-ac">
  133. <image class="icon" src="/static/img/goods-icon.png"></image>
  134. <view class="label">货款提货</view>
  135. <view class="fx-g1"></view>
  136. <view class="more fx-r fx-bc fx-ac" @tap="tapOpen" data-url="../goods/list">
  137. <view class="text">更多</view>
  138. <image class="prv" src="/static/img/ic-pev.png"></image>
  139. </view>
  140. </view>
  141. <view class="goods-items fx-r">
  142. <view @tap="tapOpen" :data-url="'../goods/index?id=' + item.id" class="item"
  143. v-for="(item,index) in topData.product">
  144. <image :src="item.img" mode="aspectFill" class="nimg"></image>
  145. <view class="title">
  146. {{ item.title }}
  147. </view>
  148. <view class="iview fx-r">
  149. <view class="score fx-r fx-be">
  150. {{ item.commission }}
  151. <view class="tag" v-if="sysData.is_audit == 0">积分</view>
  152. <view class="tag" v-else>参考价</view>
  153. </view>
  154. <view class="fx-g1"></view>
  155. <view class="btn" v-if="sysData.is_audit == 0">提货</view>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. <!--最新门店-->
  161. <view class="shop" v-if="sysData.is_audit == 0">
  162. <view class="top fx-r fx-bc fx-ac">
  163. <image class="icon" src="/static/img/shop-icon.png"></image>
  164. <view class="label">易趣C果园({{merchantCount}}家)</view>
  165. <view class="fx-g1"></view>
  166. <view class="more fx-r fx-bc fx-ac" @tap="tapOpen" data-url="../merchant/list">
  167. <view class="text">更多</view>
  168. <image class="prv" src="/static/img/ic-pev.png"></image>
  169. </view>
  170. </view>
  171. <view class="shop-items">
  172. <view class="item fx-r" @tap="tapOpen" :data-url="'../merchant/index?id=' + item.id"
  173. v-for="item in merchantData">
  174. <image :src="item.logo" class="img" mode="aspectFill"></image>
  175. <view class="info">
  176. <view class="iview-top fx-r">
  177. <view class="title">{{ item.name }}</view>
  178. <view class="fx-g1"></view>
  179. <view class="ii fx-r fx-bc">
  180. <image src="/static/img/shop-small-location.png"></image>
  181. 距离{{ item.dis_km }}
  182. </view>
  183. </view>
  184. <view class="address fx-r fx-bc">
  185. <image src="/static/img/address-shop.png" class="icon"></image>
  186. <view class="value">{{ item.address }}</view>
  187. </view>
  188. <view class="tel fx-r fx-bc">
  189. <image src="/static/img/tel-shop.png" class="icon"></image>
  190. <view class="value">{{ item.tel }}</view>
  191. </view>
  192. <view class="business">
  193. 营业时间: {{ item.business }}
  194. </view>
  195. <view class="wiget fx-r">
  196. <view class="witem fx-h fx-bc fx-ac" @tap.stop="tapTel(item)">
  197. <image src="/static/img/shop-tel.png"></image>
  198. <view class="text">电话</view>
  199. </view>
  200. <view class="wline"></view>
  201. <view class="witem fx-h fx-bc fx-ac" @tap.stop="tapLbs(item)">
  202. <image src="/static/img/shop-location.png"></image>
  203. <view class="text">导航</view>
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. </scroll-view>
  212. <customer-wiget ref="customer"></customer-wiget>
  213. <view class="popwin fx-h fx-bc fx-ac" v-if="isGg && showData">
  214. <view class="bg"></view>
  215. <view class="body fx-h fx-bc fx-ac">
  216. <image src="/static/img/index_bg.png" class="bgimg"></image>
  217. <view class="inner-top"></view>
  218. <view class="inner">
  219. <view
  220. style="text-align: center;color: #FC2D47;padding: 25rpx 0rpx;font-size: 36rpx;font-weight: bold;">
  221. {{title}}
  222. </view>
  223. <scroll-view scroll-y class="max-he">
  224. <u-parse :content="content" :noData="content" />
  225. </scroll-view>
  226. <view class="fx-r fx-bc fx-ac foot" style="margin-top: 60rpx;">
  227. <view class="btn" @tap="tapYGdBtn">未阅读,去查看></view>
  228. </view>
  229. </view>
  230. <view class="m-close">
  231. <image src="/static/img/btn-close.png" @tap="isGg = false" class="icon"></image>
  232. </view>
  233. </view>
  234. </view>
  235. </view>
  236. </template>
  237. <script>
  238. import uParse from '@/components/gaoyia-parse/parse.vue';
  239. import maoScroll from '@/components/mao-scroll/mao-scroll.vue';
  240. import customerWiget from '@/components/ui-public/customer-wiget.vue';
  241. import {
  242. mapState,
  243. mapMutations
  244. } from 'vuex';
  245. export default {
  246. computed: mapState(['user', 'lbs', 'sysData']),
  247. components: {
  248. uParse,
  249. maoScroll,
  250. customerWiget
  251. },
  252. watch: {
  253. showData(newValue, oldValue) {
  254. this.isShowInit(newValue);
  255. }
  256. },
  257. data() {
  258. return {
  259. statusBarHeight: 20,
  260. h5Foot: 0, //h5端
  261. topData: {
  262. banner: [],
  263. notice: [],
  264. product: []
  265. },
  266. content: "",
  267. title: '',
  268. isGg: false,
  269. gGid: 0,
  270. merchantData: [],
  271. guData: null,
  272. merchantCount: 0,
  273. page: {
  274. page: 1,
  275. isLoad: false,
  276. isFoot: false
  277. },
  278. wenAr: {},
  279. isLoad: false,
  280. // #ifdef APP
  281. showData: false,
  282. // #endif
  283. // #ifndef APP
  284. showData: true,
  285. // #endif
  286. }
  287. },
  288. onLoad() {
  289. this.initView();
  290. // #ifdef APP
  291. this.isShowInit(false);
  292. // #endif
  293. },
  294. onReachBottom() {
  295. if (this.page.isFoot || this.page.isLoad) {
  296. return;
  297. }
  298. this.page.page++;
  299. this.getData();
  300. },
  301. methods: {
  302. ...mapMutations(['setSys', 'getGps']),
  303. // #ifdef APP
  304. isShowInit(type) {
  305. uni.setTabBarItem({
  306. index: 1,
  307. visible: type,
  308. });
  309. // uni.setTabBarItem({
  310. // index:2,
  311. // visible:type,
  312. // })
  313. },
  314. // #endif
  315. initView: function() {
  316. // #ifdef H5
  317. this.h5Foot = 50;
  318. // #endif
  319. uni.getSystemInfo({
  320. success: (res) => {
  321. this.statusBarHeight = res.statusBarHeight;
  322. }
  323. });
  324. this
  325. .request
  326. .post("indexInit")
  327. .then(res => {
  328. uni.hideLoading();
  329. if (res.code == 200) {
  330. this.isLoad = true;
  331. this.topData = res.data;
  332. this.getData(true);
  333. //获取文票系统
  334. this.wenpiao();
  335. if (this.user != null) {
  336. //获取自己场馆
  337. this.getGu();
  338. }
  339. let gongId = uni.getStorageSync('gonggao') || '';
  340. if (this.topData.notice.length > 0 && gongId != this.topData.notice[0].id) {
  341. this.gGid = this.topData.notice[0].id;
  342. this.getNoticPop(this.topData.notice[0].id);
  343. }
  344. }
  345. })
  346. .catch(err => {
  347. this.utils.Tip("加载失败,重新点击尝试!" + JSON.stringify(error));
  348. uni.hideLoading();
  349. });
  350. // #ifdef APP
  351. this.initSys();
  352. // #endif
  353. // #ifndef APP
  354. this.setSys({
  355. is_audit: 0
  356. });
  357. this.getGps({
  358. page: this,
  359. fn: (res) => {
  360. console.log(res);
  361. this.getData(true);
  362. },
  363. err: (err) => {
  364. this.getData(true);
  365. }
  366. });
  367. // #endif
  368. },
  369. // #ifdef APP
  370. /**
  371. * 基本逻辑
  372. */
  373. initSys: function() {
  374. const that = this;
  375. const appType = uni.getSystemInfoSync().platform;
  376. if (plus != null) {
  377. plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
  378. let versionCode = wgtinfo.versionCode;
  379. let arr1 = wgtinfo.version.split('.');
  380. uni.setStorageSync("showData", false);
  381. that.showData = false;
  382. this.request.post("sysInit", {
  383. code: versionCode
  384. })
  385. .then(res => {
  386. if (res.code == 200) {
  387. this.setSys(res.data);
  388. if (appType != "ios") {
  389. if (wgtinfo.versionCode < res.data.app_code) {
  390. uni.setStorageSync("showData", true);
  391. that.showData = false;
  392. const upDater = uni.requireNativePlugin("CL-UpDater");
  393. let options = {
  394. title: "升级",
  395. con: res.data.app_update,
  396. downUrl: this.$device.platform == 'ios' ? encodeURI(res
  397. .data.ios_url) : encodeURI(res.data
  398. .android_url), //必填
  399. hidCancelbtn: true, //是否隐藏取消按钮;
  400. btnBgColor: "#ff3300", //设置按钮背景色颜色
  401. updateBtnText: "升级", //升级按钮文字,默认为立即升级
  402. topImgBg: "", //非必填,用于自定义;自定义方法请参考demo,
  403. hidBackBtn: true, //可选 默认为false(即会显示后台更新按钮), 设置android 整包更新弹框是否显示后台更新按钮,这个只有android整包更新才有这个参数,热更新是是无法设置的。
  404. verCode: res.data
  405. .app_version, //最新apk版本号 可选 用于Android整包升级,避免用户取消安装apk时,重复下载问题,如果不传的话,apk将会重新下载,
  406. downMsgTip: "资源下载中,请稍后...", //可选(android)
  407. goBackBtnText: "进入后台", //可选(android)
  408. };
  409. //必需提供下载地址;
  410. upDater.startUpdate(options, () => {});
  411. } else if (wgtinfo.versionCode > res.data.app_code) {
  412. that.showData = false
  413. uni.setStorageSync("showData", false)
  414. } else {
  415. that.showData = true
  416. uni.setStorageSync("showData", true)
  417. }
  418. }
  419. if (res.data.is_audit == 0) {
  420. this.getGps({
  421. page: this,
  422. fn: (res) => {
  423. console.log(res);
  424. this.getData(true);
  425. },
  426. err: (err) => {
  427. this.getData(true);
  428. }
  429. });
  430. }
  431. }
  432. });
  433. if (appType == "ios") {
  434. const getIosUpAppUrl = 'https://itunes.apple.com/cn/lookup?id=6474850968'
  435. const iosAppStroeUrl =
  436. 'https://apps.apple.com/cn/app/%E6%98%93%E8%B6%A3cbb/id6474850968';
  437. uni.request({
  438. url: getIosUpAppUrl,
  439. method: 'POST',
  440. data: {},
  441. success: res => {
  442. let arr = res.data.results[0].version.split('.');
  443. for (let i = 0; i < arr.length; i++) {
  444. // 线上版本号
  445. const x = +arr[i];
  446. // 本地版本号
  447. const y = +arr1[i];
  448. // 判断线上版本是否小于本地版本
  449. if (x < y) {
  450. // 设置显示数据
  451. uni.setStorageSync("showData", true);
  452. that.showData = true
  453. return
  454. }
  455. // 判断线上版本是否大于本地版本
  456. else if (x > y) {
  457. uni.setStorageSync("showData", false);
  458. that.showData = false
  459. uni.showModal({
  460. title: '提示',
  461. content: '请更新应用',
  462. showCancel: false,
  463. success(e) {
  464. plus.runtime.openURL(
  465. iosAppStroeUrl
  466. );
  467. }
  468. });
  469. return
  470. }
  471. // 判断是否本地版本等于线上版本
  472. else if (x == y && i == arr.length - 1) {
  473. that.showData = true
  474. uni.setStorageSync("showData", true)
  475. return
  476. }
  477. }
  478. },
  479. fail: res => {
  480. console.log(res, 'shib');
  481. }
  482. });
  483. }
  484. });
  485. }
  486. },
  487. // #endif
  488. /**
  489. * 重要提示
  490. * @param {Object} id
  491. */
  492. getNoticPop: function(id) {
  493. this
  494. .request
  495. .post("getContent", {
  496. id: id
  497. })
  498. .then(res => {
  499. console.log(res);
  500. if (res.code == 200) {
  501. this.title = res.data.title;
  502. this.content = res.data.content;
  503. this.isGg = true;
  504. }
  505. })
  506. .catch(err => {
  507. this.utils.Tip("网络错误,请稍后尝试");
  508. });
  509. },
  510. /**
  511. * 确认阅读公告
  512. */
  513. tapYGdBtn: function() {
  514. this.isGg = false;
  515. uni.setStorageSync('gonggao', this.gGid);
  516. uni.navigateTo({
  517. url: '../news/index?id=' + this.gGid
  518. });
  519. },
  520. wenpiao: function() {
  521. this
  522. .request
  523. .get("tradeweb")
  524. .then(res => {
  525. uni.hideLoading();
  526. if (res.code == 200) {
  527. this.wenAr = res.data;
  528. }
  529. });
  530. },
  531. /**
  532. * 最新门店
  533. */
  534. getData: function(isPull = false) {
  535. if (this.page.isLoad) return;
  536. this.page.isLoad = true;
  537. var post = {};
  538. post.page = this.page.page;
  539. //gps位置
  540. console.log(this.lbs);
  541. if (this.lbs != null) {
  542. post.lat = this.utils.isDefine(this.lbs.latitude) ? this.lbs.latitude : 0;
  543. post.lng = this.utils.isDefine(this.lbs.longitude) ? this.lbs.longitude : 0;
  544. }
  545. this
  546. .request
  547. .post("merchants", post)
  548. .then(res => {
  549. uni.hideLoading();
  550. if (res.code == 200) {
  551. this.merchantData = res.data.result;
  552. this.merchantCount = res.data.count;
  553. this.page.isFoot = true;
  554. this.isLoad = true;
  555. }
  556. })
  557. .catch(error => {
  558. console.log(error);
  559. uni.hideLoading();
  560. this.utils.Tip("加载失败,重新点击尝试!");
  561. });
  562. },
  563. getGu: function() {
  564. this
  565. .request
  566. .get("indexGu")
  567. .then(res => {
  568. uni.hideLoading();
  569. if (res.code == 200) {
  570. this.guData = res.data.guData;
  571. }
  572. });
  573. },
  574. /**
  575. * 更多
  576. */
  577. tapNews: function() {
  578. uni.navigateTo({
  579. url: "../news/list"
  580. });
  581. },
  582. /**
  583. * 打开
  584. * @param {Object} ev
  585. */
  586. tapOpen: function(ev) {
  587. let url = ev.currentTarget.dataset.url;
  588. this.utils.navigateTo(url);
  589. },
  590. /**
  591. * 打开
  592. * @param {Object} ev
  593. */
  594. tapOpen2: function(ev) {
  595. let url = ev.currentTarget.dataset.url;
  596. if (!this.utils.isDefine(this.user)) {
  597. uni.navigateTo({
  598. url: "/pages/login/index"
  599. });
  600. return;
  601. }
  602. this.utils.navigateTo(url);
  603. },
  604. /**
  605. * 拨打电话
  606. */
  607. tapTel: function(item) {
  608. if (item.tel == null) {
  609. this.utils.showAlert({
  610. title: "系统提示",
  611. content: "暂无联系方式"
  612. });
  613. return;
  614. }
  615. const info = uni.getSystemInfoSync();
  616. if (info.platform == 'android') {
  617. uni.showModal({
  618. content: "确认拨打" + item.tel,
  619. confirmText: "确定",
  620. cancelText: "取消",
  621. success: (res) => {
  622. if (res.confirm) {
  623. this.$store.dispatch('permission/requestPermissions', 'CALL_PHONE').then(
  624. res => {
  625. if (res !== 1) return;
  626. uni.makePhoneCall({
  627. phoneNumber: item.tel,
  628. fail: (res) => {
  629. console.log("aaaaa");
  630. uni.showModal({
  631. content: JSON.stringify(res)
  632. });
  633. },
  634. complete: (xx) => {
  635. console.log(xx);
  636. console.log("ad");
  637. }
  638. });
  639. });
  640. }
  641. }
  642. });
  643. } else {
  644. uni.makePhoneCall({
  645. phoneNumber: item.tel,
  646. });
  647. }
  648. },
  649. tapLbs: function(item) {
  650. uni.openLocation({
  651. latitude: Number(item.lat),
  652. longitude: Number(item.lng),
  653. name: item.name,
  654. address: item.address,
  655. scale: 12,
  656. success: function() {
  657. console.log('success');
  658. },
  659. fail: function(res) {
  660. },
  661. })
  662. },
  663. }
  664. }
  665. </script>
  666. <style lang="scss">
  667. .app-top {
  668. position: fixed;
  669. height: 500rpx;
  670. width: 100%;
  671. background: #fff;
  672. .atop1 {
  673. height: 300rpx;
  674. overflow: hidden;
  675. position: relative;
  676. .top2-bg {
  677. width: 400vw;
  678. height: 400vw;
  679. background: #DB292B;
  680. border-radius: 50%;
  681. position: absolute;
  682. left: -150vw;
  683. bottom: 0;
  684. }
  685. }
  686. .atop2 {
  687. background: #fff;
  688. }
  689. }
  690. .top {
  691. .top-body {
  692. .panel {
  693. height: 80rpx;
  694. padding: 0 35rpx;
  695. .index-img {
  696. width: 80rpx;
  697. height: 48rpx;
  698. }
  699. .information {
  700. width: 38rpx;
  701. height: 38rpx;
  702. }
  703. }
  704. }
  705. }
  706. //消息信息
  707. .grid-bg {
  708. padding: 32rpx;
  709. margin-top: 20rpx;
  710. background: #fff;
  711. //9宫格
  712. .grid {
  713. .item {
  714. width: 20%;
  715. .icon {
  716. width: 90rpx;
  717. height: 90rpx;
  718. }
  719. .label {
  720. font-size: 12px;
  721. color: #0C1732;
  722. margin-top: 16rpx;
  723. }
  724. }
  725. }
  726. //消息通知
  727. .news-panel {
  728. margin-top: 40rpx;
  729. background: #F8F8FA;
  730. border-radius: 8rpx;
  731. padding: 15rpx 20rpx;
  732. .icon {
  733. width: 28rpx;
  734. height: 28rpx;
  735. }
  736. .label {
  737. margin: 0px 10rpx;
  738. font-weight: bold;
  739. font-size: 26rpx;
  740. color: #FF4C4C;
  741. }
  742. .icon-right {
  743. width: 30rpx;
  744. height: 6rpx;
  745. }
  746. .line {
  747. height: 60rpx;
  748. line-height: 32px;
  749. color: #575656;
  750. font-size: 26rpx;
  751. width: calc(100vw - 184rpx - 68rpx - 40rpx);
  752. overflow: hidden;
  753. text-overflow: ellipsis;
  754. white-space: nowrap;
  755. }
  756. }
  757. }
  758. //抢货通道
  759. .team-buy {
  760. background: #F8F8FA;
  761. padding: 20rpx 50rpx;
  762. .top {
  763. .label {
  764. color: #DB292B;
  765. font-size: 30rpx;
  766. font-weight: bold;
  767. }
  768. .sbtn {
  769. border: 2rpx solid #DB292B;
  770. border-radius: 10rpx;
  771. color: #DB292B;
  772. font-size: 24rpx;
  773. padding: 14rpx 16rpx;
  774. }
  775. }
  776. .team-show {
  777. width: 100%;
  778. height: 260rpx;
  779. border-radius: 20rpx;
  780. margin-top: 20rpx;
  781. position: relative;
  782. .bg {
  783. width: 100%;
  784. height: 260rpx;
  785. position: absolute;
  786. image {
  787. width: 100%;
  788. height: 100%;
  789. border-radius: 20rpx;
  790. }
  791. .h {
  792. background-color: rgba(0, 0, 0, 0.2);
  793. position: absolute;
  794. z-index: 9;
  795. width: 100%;
  796. height: 100%;
  797. border-radius: 20rpx;
  798. top: 0;
  799. }
  800. }
  801. .body {
  802. position: relative;
  803. z-index: 10;
  804. height: 100%;
  805. .top-input {
  806. position: relative;
  807. .tbg {
  808. width: 250rpx;
  809. height: 70rpx;
  810. }
  811. .inner {
  812. width: 100%;
  813. height: 100%;
  814. position: absolute;
  815. top: 0;
  816. left: 0;
  817. image {
  818. width: 28rpx;
  819. height: 28rpx;
  820. }
  821. .label {
  822. color: #fff;
  823. font-weight: bold;
  824. font-size: 36rpx;
  825. margin-left: 6rpx;
  826. }
  827. }
  828. }
  829. .info {
  830. width: 100%;
  831. .item {
  832. width: calc(33% - 1px);
  833. .name {
  834. color: #fff;
  835. font-size: 30rpx;
  836. margin-top: 24rpx;
  837. }
  838. .label {
  839. color: #fff;
  840. width: 80%;
  841. font-size: 30rpx;
  842. font-weight: bold;
  843. overflow: hidden;
  844. text-overflow: ellipsis;
  845. white-space: nowrap;
  846. text-align: center;
  847. }
  848. .people {
  849. image {
  850. width: 26rpx;
  851. height: 34rpx;
  852. }
  853. }
  854. }
  855. .halving {
  856. width: 2rpx;
  857. height: 80rpx;
  858. background: #fff;
  859. }
  860. }
  861. }
  862. }
  863. }
  864. //文票系统
  865. .tradeweb {
  866. padding: 20rpx 50rpx;
  867. background: #fff;
  868. position: relative;
  869. .bg {
  870. image {
  871. width: calc(100vw - 100rpx);
  872. height: calc(27vw - 27rpx);
  873. }
  874. }
  875. .ivpop {
  876. position: absolute;
  877. right: 60rpx;
  878. top: 6vw;
  879. .lv {
  880. width: 100rpx;
  881. height: 100rpx;
  882. border-radius: 50%;
  883. border: 1px solid #FFFFFF;
  884. text-align: center;
  885. line-height: 100rpx;
  886. color: #fff;
  887. font-size: 14px;
  888. }
  889. .v {
  890. font-size: 20rpx;
  891. color: #FFFFFF;
  892. }
  893. }
  894. .ibody {
  895. position: absolute;
  896. top: 20rpx;
  897. left: 50rpx;
  898. width: calc(100% - 100rpx);
  899. height: calc(100% - 27rpx);
  900. z-index: 1;
  901. .t1 {
  902. border-radius: 16rpx;
  903. font-size: 10px;
  904. color: #fff;
  905. padding: 0px 20rpx;
  906. border: 1px solid #FFFFFF;
  907. margin-top: 20rpx;
  908. }
  909. .name {
  910. font-weight: 800;
  911. font-size: 52rpx;
  912. color: #FFFFFF;
  913. }
  914. .wname {
  915. color: #CA3236;
  916. font-size: 12px;
  917. position: absolute;
  918. bottom: 5vw;
  919. left: 21vw;
  920. }
  921. }
  922. }
  923. //产品中心
  924. .goods {
  925. background: #fff;
  926. padding: 20rpx;
  927. .top {
  928. .icon {
  929. width: 36rpx;
  930. height: 36rpx;
  931. }
  932. .label {
  933. color: #000000;
  934. font-weight: bold;
  935. font-size: 34rpx;
  936. margin-left: 12rpx;
  937. }
  938. .more {
  939. .text {
  940. color: #9A9A9A;
  941. font-size: 24rpx;
  942. }
  943. .prv {
  944. width: 10rpx;
  945. height: 20rpx;
  946. margin-left: 8rpx;
  947. }
  948. }
  949. }
  950. .goods-items {
  951. .item {
  952. width: calc(50% - 10rpx);
  953. margin-right: 10rpx;
  954. margin-top: 20rpx;
  955. box-shadow: 0px 0px 20px 0px rgba(50, 50, 52, 0.1);
  956. border-radius: 20rpx;
  957. &:nth-child(2n) {
  958. margin-left: 10rpx;
  959. margin-right: 0;
  960. }
  961. .nimg {
  962. width: 100%;
  963. height: calc(50vw - 20rpx - 10rpx);
  964. border-radius: 20rpx 20rpx 0 0;
  965. }
  966. .title {
  967. padding: 20rpx;
  968. height: 80rpx;
  969. overflow: hidden;
  970. text-overflow: ellipsis;
  971. display: -webkit-box;
  972. -webkit-box-orient: vertical;
  973. -webkit-line-clamp: 2;
  974. color: #333333;
  975. font-weight: bold;
  976. font-size: 30rpx;
  977. }
  978. .iview {
  979. padding: 20rpx;
  980. .score {
  981. color: #FF4C4C;
  982. font-weight: bold;
  983. font-size: 36rpx;
  984. .tag {
  985. font-weight: bold;
  986. font-size: 18rpx;
  987. color: #FF4C4C;
  988. }
  989. }
  990. .btn {
  991. background: linear-gradient(143.2747deg, #FF6A00, #EE0979);
  992. border-radius: 40rpx;
  993. padding: 10rpx 28rpx;
  994. font-size: 22rpx;
  995. color: #FFFFFF;
  996. }
  997. }
  998. }
  999. }
  1000. }
  1001. //最新门店
  1002. .shop {
  1003. background: #fff;
  1004. padding: 20rpx;
  1005. margin-top: 40rpx;
  1006. .top {
  1007. .icon {
  1008. width: 36rpx;
  1009. height: 36rpx;
  1010. }
  1011. .label {
  1012. color: #000000;
  1013. font-weight: bold;
  1014. font-size: 34rpx;
  1015. margin-left: 12rpx;
  1016. }
  1017. .more {
  1018. .text {
  1019. color: #9A9A9A;
  1020. font-size: 24rpx;
  1021. }
  1022. .prv {
  1023. width: 10rpx;
  1024. height: 20rpx;
  1025. margin-left: 8rpx;
  1026. }
  1027. }
  1028. }
  1029. .shop-items {
  1030. .item {
  1031. margin-top: 30rpx;
  1032. .img {
  1033. width: 180rpx;
  1034. height: 180rpx;
  1035. border-radius: 10rpx;
  1036. }
  1037. .info {
  1038. position: relative;
  1039. margin-left: 20rpx;
  1040. width: calc(100% - 200rpx);
  1041. border-bottom: 1px solid #F8F8F8;
  1042. .title {
  1043. font-weight: bold;
  1044. font-size: 34rpx;
  1045. color: #333333;
  1046. width: calc(60%);
  1047. overflow: hidden;
  1048. text-overflow: ellipsis;
  1049. white-space: nowrap;
  1050. }
  1051. .ii {
  1052. image {
  1053. width: 20rpx;
  1054. height: 28rpx;
  1055. margin-right: 8rpx
  1056. }
  1057. font-weight: 400;
  1058. font-size: 22rpx;
  1059. color: #666666;
  1060. }
  1061. .address {
  1062. .icon {
  1063. width: 28rpx;
  1064. height: 28rpx;
  1065. }
  1066. .value {
  1067. font-size: 22rpx;
  1068. color: #666666;
  1069. opacity: 0.5;
  1070. margin-left: 10rpx;
  1071. }
  1072. margin-top: 20rpx;
  1073. }
  1074. .tel {
  1075. margin-top: 16rpx;
  1076. .icon {
  1077. width: 28rpx;
  1078. height: 28rpx;
  1079. }
  1080. .value {
  1081. font-size: 22rpx;
  1082. color: #666666;
  1083. opacity: 0.5;
  1084. margin-left: 10rpx;
  1085. }
  1086. }
  1087. .business {
  1088. font-weight: bold;
  1089. font-size: 24rpx;
  1090. color: #FF6F0F;
  1091. background: rgba(252, 243, 240, 0.8);
  1092. border-radius: 16rpx 16rpx 16rpx 0px;
  1093. padding: 10rpx 10rpx;
  1094. display: inline-block;
  1095. margin-bottom: 20rpx;
  1096. }
  1097. .wiget {
  1098. position: absolute;
  1099. right: 0;
  1100. bottom: 20rpx;
  1101. .wline {
  1102. margin: 0px 24rpx;
  1103. height: 40rpx;
  1104. width: 1px;
  1105. background: #eee;
  1106. }
  1107. .witem {
  1108. image {
  1109. width: 46rpx;
  1110. height: 46rpx;
  1111. }
  1112. .text {
  1113. font-size: 14px;
  1114. color: #666666;
  1115. margin-top: 8rpx;
  1116. }
  1117. }
  1118. }
  1119. }
  1120. }
  1121. }
  1122. }
  1123. /**弹出框 **/
  1124. .popwin {
  1125. position: fixed;
  1126. width: 100%;
  1127. height: 100%;
  1128. top: 0;
  1129. left: 0;
  1130. z-index: 88;
  1131. }
  1132. .popwin .bg {
  1133. background: rgba(0, 0, 0, 0.5);
  1134. height: 100%;
  1135. width: 100%;
  1136. position: absolute;
  1137. left: 0;
  1138. top: 0;
  1139. }
  1140. .popwin .body {
  1141. position: relative;
  1142. border-radius: 8px;
  1143. width: 100%;
  1144. width: 80vw;
  1145. }
  1146. .popwin .body .bgimg {
  1147. width: 80vw;
  1148. height: 120vw;
  1149. position: absolute;
  1150. top: 0;
  1151. }
  1152. .popwin .body .inner {
  1153. position: relative;
  1154. z-index: 99;
  1155. width: calc(100% - 80rpx);
  1156. padding: 0px 40rpx;
  1157. }
  1158. .inner-top {
  1159. height: 30vw;
  1160. }
  1161. .max-he {
  1162. height: 43vw;
  1163. }
  1164. .foot {
  1165. height: 26vw;
  1166. }
  1167. .popwin .btn {
  1168. background: linear-gradient(0deg, #FAC37B, #FFF5B0);
  1169. box-shadow: 2px 7px 7px 0px rgba(161, 23, 36, 0.4);
  1170. border-radius: 15rpx;
  1171. height: 66rpx;
  1172. width: 45vw;
  1173. font-size: 38rpx;
  1174. color: #97000E;
  1175. text-align: center;
  1176. line-height: 66rpx
  1177. }
  1178. .popwin .m-close {
  1179. margin-top: 10px;
  1180. }
  1181. .popwin .m-close image {
  1182. width: 120rpx;
  1183. height: 120rpx;
  1184. }
  1185. </style>