user.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. <template>
  2. <view class="container">
  3. <!-- #ifdef APP-PLUS -->
  4. <view class="bar-height"></view>
  5. <!-- #endif -->
  6. <!-- <scroll-view class="content-box" scroll-y="true"> -->
  7. <view class="user-section">
  8. <view class="bg">
  9. <image src="../../static/user/ground.png" mode=""></image>
  10. </view>
  11. <!-- top -->
  12. <view class="user-box">
  13. <view class="user-info-box ">
  14. <view class="detail flex" @click="navTo('/pages/userinfo/userinfo')">
  15. <view class="portrait-box">
  16. <image class="portrait" :src="userInfo.avatar || '/static/error/missing-face.png'"></image>
  17. </view>
  18. <view class="info-box">
  19. <view class="username">{{ userInfo.nickname || '游客' }}</view>
  20. <view class="font-size-sm" v-if="userInfo.uid">邀请码:{{ userInfo.uid }}<text
  21. v-if="userInfo.level == 1" style="color: #5dbc7c;margin-left: 10rpx;">会员</text><text
  22. v-if="userInfo.level == 2"
  23. style="color: #dab176;margin-left: 10rpx;">副店长</text><text
  24. v-if="userInfo.level == 3" style="color: #dab176;margin-left: 10rpx;">店长</text>
  25. </view>
  26. <view class="font-size-sm" style="color: #5dbc7c;"
  27. v-if="userInfo.level == 1 && userInfo.service == 0">
  28. {{'会员股权:' + userInfo.vip.stock_rights + ' 消费股权:' + userInfo.vip.consume_rights}}
  29. </view>
  30. </view>
  31. </view>
  32. <view class="config">
  33. <view class="setting " @click="navTo('/pages/userinfo/userinfo')">
  34. <image src="../../static/user/set.png" mode=""></image>
  35. </view>
  36. 设置
  37. </view>
  38. </view>
  39. <view class="sy-box flex">
  40. <view class="sy-item">
  41. <view class="sy-item-name">团队等级</view>
  42. <view class="sy-item-val">
  43. {{ userInfo.group_level_info != null? userInfo.group_level_info.name : '无' }}
  44. </view>
  45. </view>
  46. <view class="jg"></view>
  47. <view class="sy-item">
  48. <view class="sy-item-name">极差奖励等级</view>
  49. <!-- <view class="sy-item-val">{{jcdj}}</view> -->
  50. <view class="sy-item-val">
  51. {{userInfo.award_level_info!= null? userInfo.award_level_info.name : '无'}}
  52. </view>
  53. </view>
  54. <view class="jg"></view>
  55. <view class="sy-item">
  56. <view class="sy-item-name">冻结极差奖</view>
  57. <view class="sy-item-val">{{ userInfo.lock_group_award || 0 }}</view>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 会员卡功能 -->
  62. </view>
  63. <view class="item-box">
  64. <image class="arc" src="/static/img/arc.png"></image>
  65. <view class="mendian">
  66. <view class="mendian-lift" v-if="userInfo.level == 1 && userInfo.service == 0">
  67. <view class="img">
  68. <image src="../../static/img/mendian01.png" mode=""></image>
  69. </view>
  70. <text class="null-mendian">{{ userInfo.store_name}}</text>
  71. </view>
  72. <view class="mendian-lift" v-else>
  73. </view>
  74. <view class="mendian-lift" @click="openhym" v-if="userInfo.vip &&userInfo.vip.card_no">
  75. NO:{{userInfo.vip.card_no}}
  76. <image src="../../static/icon/hym.png" mode="" class="hym">
  77. </view>
  78. <view class="mendian-lift" @click="openhym" v-else>
  79. NO:{{userInfo.SN}}
  80. <image src="../../static/icon/hym.png" mode="" class="hym">
  81. </view>
  82. </view>
  83. <view class="my-order">
  84. <view class="box-title flex borde-b">
  85. <view class="title"><text>我的订单</text></view>
  86. <view class="link" @click="navTo('/pages/order/order?state=5')" hover-class="common-hover"><text
  87. class="iconfont iconenter"></text></view>
  88. </view>
  89. <view class="order-section">
  90. <view class="order-item" @click="navTo('/pages/order/order?state=1')" hover-class="common-hover"
  91. :hover-stay-time="50">
  92. <view class=" icon1 position-relative">
  93. <image class="icon-img" src="/static/icon/i2.png" mode="aspectFit"></image>
  94. <view class="corner" v-if="orderInfo.unshipped_count > 0">
  95. <text>{{ orderInfo.unshipped_count }}</text>
  96. </view>
  97. </view>
  98. <text>待发货</text>
  99. </view>
  100. <view class="order-item" @click="navTo('/pages/order/order?state=2')" hover-class="common-hover"
  101. :hover-stay-time="50">
  102. <view class="icon1 position-relative">
  103. <image class="icon-img" src="/static/icon/i3.png" mode="aspectFit"></image>
  104. <view class="corner" v-if="orderInfo.received_count > 0">
  105. <text>{{ orderInfo.received_count }}</text>
  106. </view>
  107. </view>
  108. <text>待收货</text>
  109. </view>
  110. <view class="order-item" @click="navTo('/pages/order/order?state=3')" hover-class="common-hover"
  111. :hover-stay-time="50">
  112. <view class="icon1 position-relative">
  113. <image class="icon-img" src="/static/icon/i4.png" mode="aspectFit"></image>
  114. <view class="corner" v-if="orderInfo.evaluated_count > 0">
  115. <text>{{ orderInfo.evaluated_count }}</text>
  116. </view>
  117. </view>
  118. <text>待评价</text>
  119. </view>
  120. <view class="order-item" @click="navTo('/pages/order/refundOrder?state=0')"
  121. hover-class="common-hover" :hover-stay-time="50">
  122. <view class=" icon1 position-relative">
  123. <image class="icon-img" src="/static/icon/i1.png" mode="aspectFit"></image>
  124. </view>
  125. <text>退款</text>
  126. </view>
  127. </view>
  128. </view>
  129. <view class="my-order">
  130. <view class="box-title flex borde-b">
  131. <view class="title"><text>我的单数</text></view>
  132. </view>
  133. <view class="order-section">
  134. <view class="order-item">
  135. <view class="order-num">
  136. {{userInfo.suit_num || 0}}
  137. </view>
  138. <text>套装单数</text>
  139. </view>
  140. <view class="xian"></view>
  141. <view class="order-item">
  142. <view class="order-num">
  143. {{userInfo.recommend_suit_num || 0}}
  144. </view>
  145. <text>直推单数</text>
  146. </view>
  147. <view class="xian"></view>
  148. <view class="order-item">
  149. <view class="order-num">
  150. {{userInfo.group_suit_num || 0}}
  151. </view>
  152. <text>团队单数</text>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. <!-- <view class="cover-container"> -->
  158. <view class="vip" @click="navTo('/pages/wallet/openMember')"></view>
  159. <!-- 订单 -->
  160. <view class="item-box " v-if="isShowIllegality">
  161. <view class="order-section order">
  162. <view class="order-item" @click="navTo('/pages/wallet/wallet')" hover-class="common-hover"
  163. :hover-stay-time="50">
  164. <view class=" icon position-relative">
  165. <image class="icon-img" src="../../static/user/balance.png" mode="aspectFit"></image>
  166. </view>
  167. <text>我的余额</text>
  168. </view>
  169. <view class="order-item" @click="navTo('/pages/award/award')" hover-class="common-hover"
  170. :hover-stay-time="50">
  171. <view class=" icon position-relative">
  172. <image class="icon-img" src="../../static/user/commission.png" mode="aspectFit"></image>
  173. </view>
  174. <text>我的佣金</text>
  175. </view>
  176. <view class="order-item" @click="navTo('/pages/coupon/consumer')" hover-class="common-hover"
  177. :hover-stay-time="50">
  178. <view class=" icon position-relative">
  179. <image class="icon-img" src="../../static/user/coupon.png" mode="aspectFit"></image>
  180. </view>
  181. <text>我的消费券</text>
  182. </view>
  183. <view class="order-item" @click="navTo('/pages/scoreAccumulate/scoreAccumulate')"
  184. hover-class="common-hover" :hover-stay-time="50">
  185. <view class=" icon position-relative">
  186. <image class="icon-img" src="../../static/user/integral.png" mode="aspectFit"></image>
  187. </view>
  188. <text>我的积分</text>
  189. </view>
  190. </view>
  191. <!-- 浏览历史 -->
  192. <view class="history-section ">
  193. <uni-list>
  194. <uni-list-item v-if="isShowIllegality" title="我的推广" @click="navTo('/pages/myteam/myteam')"
  195. thumb="/static/user/tuiguang.png"></uni-list-item>
  196. <uni-list-item title="邀请海报" @click="navTo('/pages/shareQrCode/index')"
  197. thumb="/static/user/haibao.png"></uni-list-item>
  198. <uni-list-item title="兑换会员卡" @click="go" thumb="/static/icon/czhy.png"
  199. v-if="userInfo.level == 0"></uni-list-item>
  200. <!-- <uni-list-item title="兑换会员卡" @click="go" thumb="/static/icon/czhy.png"></uni-list-item> -->
  201. <uni-list-item title="我的收藏" @click="navTo('/pages/favorites/favorites')"
  202. thumb="/static/user/collect.png"></uni-list-item>
  203. <uni-list-item title="百业推广" @click="navTo('/pages/myteam/myteamQian')"
  204. thumb="/static/user/tui.png"></uni-list-item>
  205. <uni-list-item title="收货地址" @click="navTo('/pages/address/address')"
  206. thumb="/static/user/address.png"></uni-list-item>
  207. <uni-list-item title="商家入口" @click="navTo('/pages/merchant/merchant')"
  208. thumb="/static/user/shopping.png" v-if="userInfo.service == 1 || type==1"></uni-list-item>
  209. <uni-list-item :title="'商家入驻'+(type==-1?'':type==0?'(审核中)':type==1?'(成功)':'(失败)')"
  210. @click="navTo('/pages/merchant/becomeShop')" thumb="/static/user/complete.png"></uni-list-item>
  211. </uni-list>
  212. </view>
  213. </view>
  214. <!-- </scroll-view> -->
  215. <uni-popup ref="hympop" type="center">
  216. <view class="hym-wrap">
  217. <view class="hym-tit">
  218. 我的会员码
  219. </view>
  220. <view class="hym-val">
  221. <tki-qrcode :key="hym" cid="tki-qrcode-canvas" ref="qrcode" :val="hym" :size="300" unit="upx"
  222. background="#ffffff" foreground="#333333" pdground="#333333" icon="" :iconSize="0" :lv="3"
  223. :onval="true" :loadMake="true" :usingComponents="true" />
  224. </view>
  225. <view class="hym-num">
  226. 会员编号:{{hym}}
  227. </view>
  228. </view>
  229. </uni-popup>
  230. <uni-popup ref="popup" type="center">
  231. <view class="popup-box">
  232. <view class="img">
  233. <view class="img-font">兑换会员卡</view>
  234. <view class="img-bg">
  235. <image src="../../static/img/img009.png" mode=""></image>
  236. </view>
  237. </view>
  238. <view class="mian">
  239. <view class="main-item">
  240. <view class="font">卡号</view>
  241. <input type="text" v-model="card" class="input" placeholder="请输入卡号"
  242. placeholder-class="input-font" />
  243. </view>
  244. <view class="main-item" style="margin-top: 40rpx;">
  245. <view class="font">密码</view>
  246. <input type="password" v-model="pwd" placeholder="请输入密码" class="input"
  247. placeholder-class="input-font" />
  248. </view>
  249. <view class="main-item" style="margin-top: 40rpx;">
  250. <view class="font">选择门店</view>
  251. <view class="input" @click="chooseStore">{{ storeInfo.name || '请选择门店' }}</view>
  252. </view>
  253. <view class="comfirm-box">
  254. <view class="cancel" @click="cancel">取消</view>
  255. <view class="comfirm" @click="comfirm()">确认兑换</view>
  256. </view>
  257. </view>
  258. </view>
  259. </uni-popup>
  260. </view>
  261. </template>
  262. <script>
  263. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  264. import {
  265. verification,
  266. storeIndex
  267. } from '@/api/merchant.js';
  268. import {
  269. mapState,
  270. mapMutations
  271. } from 'vuex';
  272. import uniList from '@/components/uni-list/uni-list.vue';
  273. import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
  274. import {
  275. orderData,
  276. orderVerific
  277. } from '@/api/user.js';
  278. import {
  279. getUserInfo
  280. } from '@/api/login.js';
  281. import tkiQrcodes from '@/components/tki-qrcode/tki-qrcode.vue';
  282. let startY = 0,
  283. moveY = 0,
  284. pageAtTop = true;
  285. export default {
  286. components: {
  287. uniList,
  288. uniListItem,
  289. uniPopup,
  290. tkiQrcodes
  291. },
  292. data() {
  293. return {
  294. type: -1, //-1无事发生0审核中1成功2失败
  295. hym: '', //会员编号
  296. coverTransform: 'translateY(0px)',
  297. coverTransition: '0s',
  298. moving: false,
  299. userDowm: 0, //卡片升级专属高度
  300. userMaxDowm: 0, //卡片最高高度
  301. orderinfo: {
  302. complete_count: 0,
  303. received_count: 0,
  304. unshipped_count: 0,
  305. order_count: 0
  306. },
  307. // 判断是否已经点击过一次取消关注公众号
  308. watchful: true,
  309. card: '',
  310. pwd: '',
  311. // storeInfo: {
  312. // name: ''
  313. // },
  314. qrsize: 80, // 二维码大小
  315. cid: 'tki-qrcode-canvas', //canvasId,页面存在多个二维码组件时需设置不同的ID
  316. size: 500, //生成的二维码大小
  317. unit: 'upx', //大小单位尺寸
  318. // show: true,//默认使用组件中的image标签显示二维码
  319. val: '', //要生成的内容
  320. background: '#ffffff', //二维码背景色
  321. foreground: '#333333', //二维码前景色
  322. pdground: '#333333', //二维码角标色
  323. icon: '', //二维码图标URL(必须是本地图片,网络图需要先下载至本地)
  324. iconSize: 40, //二维码图标大小
  325. lv: 3, //容错级别
  326. onval: true, //监听val值变化自动重新生成二维码
  327. loadMake: false, //组件初始化完成后自动生成二维码,val需要有值
  328. usingComponents: false, //是否使用了自定义组件模式(主要是为了修复非自定义组件模式时 v-if 无法生成二维码的问题)
  329. showLoading: true, //是否显示loading
  330. loadingText: '二维码生成中', //loading文字
  331. src: '', // 二维码生成后的图片地址或base64
  332. ratio: 1, //页面比例用于计算
  333. ctxSrc: '', //要显示的图片
  334. loading: true, //是否载入图片中
  335. };
  336. },
  337. onShow() {
  338. // 判断是否已经登录
  339. if (this.hasLogin) {
  340. this.loadBaseData();
  341. }
  342. },
  343. onReady() {
  344. // 初始化获取页面宽度
  345. uni.createSelectorQuery()
  346. .select('.container')
  347. .fields({
  348. size: true
  349. },
  350. data => {
  351. // 计算最多下拉的高度
  352. this.userDowm = Math.floor((data.width / 750) * 200);
  353. // 计算最大触发修改高度事件
  354. this.userMaxDowm = Math.floor((data.width / 750) * 250);
  355. }
  356. )
  357. .exec();
  358. },
  359. computed: {
  360. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  361. jcdj() {
  362. if (this.userInfo.award_level_info != null) {
  363. if (this.userInfo.group_level_info != null) {
  364. return this.userInfo.award_level_info.id < this.userInfo.group_level_info.id ? this.userInfo
  365. .award_level_info.name : this.userInfo.group_level_info.name
  366. } else {
  367. return this.userInfo.award_level_info.name
  368. }
  369. } else {
  370. if (this.userInfo.group_level_info != null) {
  371. return this.userInfo.group_level_info.name
  372. } else {
  373. return '无'
  374. }
  375. }
  376. },
  377. // #ifdef H5
  378. ...mapState(['weichatObj']),
  379. // #endif
  380. ...mapState(['isShowIllegality', 'canChange', 'storeInfo'])
  381. },
  382. methods: {
  383. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  384. // 打开会员码
  385. openhym() {
  386. if (this.userInfo.vip.card_no) {
  387. this.hym = this.userInfo.vip.card_no
  388. } else {
  389. this.hym = this.userInfo.SN
  390. }
  391. this.$refs.hympop.open()
  392. },
  393. // 加载初始数据
  394. loadBaseData() {
  395. let obj = this;
  396. getUserInfo({})
  397. .then(({
  398. data
  399. }) => {
  400. orderData({})
  401. .then(({
  402. data
  403. }) => {
  404. obj.setOrderInfo(data);
  405. })
  406. .catch(e => {
  407. obj.setOrderInfo({
  408. complete_count: 0, //完成
  409. received_count: 0, //待收货
  410. unshipped_count: 0, //待发货
  411. order_count: 0, //订单总数
  412. unpaid_count: 0 //待付款
  413. });
  414. });
  415. obj.setUserInfo(data);
  416. // 判断是否已经关注公众号
  417. if (data.wechat.subscribe == 0 && obj.watchful) {
  418. uni.showModal({
  419. title: '温馨提醒',
  420. content: '为提供更好的服务,请关注公众号。',
  421. success: res => {
  422. obj.watchful = false;
  423. // 判断是否点击了确认
  424. if (res.confirm) {
  425. uni.navigateTo({
  426. url: '/pages/shareQrCode/wechatQr'
  427. });
  428. }
  429. }
  430. });
  431. }
  432. })
  433. .catch(e => {
  434. console.log(e);
  435. });
  436. storeIndex({}).then(e => {
  437. if (!e.data.apply) {
  438. obj.type = -1;
  439. if (e.data.store_info) {
  440. obj.type = 1;
  441. }
  442. } else {
  443. obj.type = e.data.apply.status;
  444. }
  445. })
  446. },
  447. /**
  448. * 统一跳转接口,拦截未登录路由
  449. * navigator标签现在默认没有转场动画,所以用view
  450. */
  451. navTo(url) {
  452. if (!this.hasLogin) {
  453. url = '/pages/public/login';
  454. // #ifdef H5
  455. let weichatBrowser = uni.getStorageSync('weichatBrowser');
  456. // 判断是否为微信浏览器
  457. if (weichatBrowser) {
  458. url = '/pages/public/wxLogin';
  459. }
  460. // #endif
  461. // #ifdef MP-WEIXIN
  462. url = '/pages/public/wxLogin';
  463. // #endif
  464. }
  465. uni.navigateTo({
  466. url
  467. });
  468. },
  469. /**
  470. * 会员卡下拉和回弹
  471. * 1.关闭bounce避免ios端下拉冲突
  472. * 2.由于touchmove事件的缺陷(以前做小程序就遇到,比如20跳到40,h5反而好很多),下拉的时候会有掉帧的感觉
  473. * transition设置0.1秒延迟,让css来过渡这段空窗期
  474. * 3.回弹效果可修改曲线值来调整效果,推荐一个好用的bezier生成工具 http://cubic-bezier.com/
  475. */
  476. coverTouchstart(e) {
  477. // console.log(e);
  478. if (pageAtTop === false) {
  479. return;
  480. }
  481. this.coverTransition = 'transform .1s linear';
  482. startY = e.touches[0].clientY;
  483. },
  484. coverTouchmove(e) {
  485. // console.log(e);
  486. moveY = e.touches[0].clientY;
  487. let moveDistance = moveY - startY;
  488. let maxDowm = this.userMaxDowm;
  489. let Dowm = this.userDowm;
  490. if (moveDistance < 0) {
  491. this.moving = false;
  492. return;
  493. }
  494. this.moving = true;
  495. if (moveDistance >= Dowm && moveDistance < maxDowm) {
  496. moveDistance = Dowm;
  497. }
  498. if (moveDistance > 0 && moveDistance <= Dowm) {
  499. this.coverTransform = `translateY(${moveDistance}px)`;
  500. }
  501. },
  502. coverTouchend() {
  503. if (this.moving === false) {
  504. return;
  505. }
  506. this.moving = false;
  507. this.coverTransition = 'transform 0.3s cubic-bezier(.21,1.93,.53,.64)';
  508. this.coverTransform = 'translateY(0px)';
  509. },
  510. // 核销
  511. openQr() {
  512. let obj = this;
  513. // #ifndef H5
  514. uni.scanCode({
  515. success(e) {
  516. obj.orderVerific(e.result);
  517. }
  518. });
  519. // #endif
  520. // #ifdef H5
  521. this.weichatObj.scanQRCode({
  522. needResult: 1, // 默认为0,扫描结果由微信处理,1则直接返回扫描结果,
  523. scanType: ['qrCode', 'barCode'], // 可以指定扫二维码还是一维码,默认二者都有
  524. success: function(res) {
  525. obj.orderVerific(res.resultStr); // 当needResult 为 1 时,扫码返回的结果
  526. }
  527. });
  528. // #endif
  529. },
  530. // 核销请求
  531. orderVerific(data) {
  532. orderVerific({
  533. verify_code: data
  534. })
  535. .then(e => {
  536. uni.showModal({
  537. title: '核销',
  538. content: '已核销成功',
  539. showCancel: false
  540. });
  541. })
  542. .catch(e => {
  543. uni.showModal({
  544. title: '错误',
  545. content: JSON.stringify(e),
  546. showCancel: false
  547. });
  548. console.log(e);
  549. });
  550. },
  551. // 选择门店
  552. chooseStore() {
  553. if (this.canChange == 0) {
  554. return
  555. } else {
  556. uni.navigateTo({
  557. url: '/pages/shoping/list?type=3'
  558. });
  559. }
  560. },
  561. go() {
  562. this.$refs.popup.open();
  563. },
  564. cancel() {
  565. this.$refs.popup.close();
  566. this.card = '';
  567. this.pwd = '';
  568. // this.storeInfo = { name: '' };
  569. },
  570. comfirm() {
  571. verification({
  572. card_number: this.card,
  573. card_password: this.pwd,
  574. type: 0,
  575. is_confirm: 1,
  576. reg_store_id: this.storeInfo.id
  577. })
  578. .then(e => {
  579. console.log(e);
  580. this.card = '';
  581. this.pwd = '';
  582. // this.storeInfo = { name: '' };
  583. this.loadBaseData()
  584. })
  585. .catch(e => {
  586. console.log(e);
  587. this.card = '';
  588. this.pwd = '';
  589. // this.storeInfo = { name: '' };
  590. });
  591. this.$refs.popup.close();
  592. }
  593. }
  594. };
  595. </script>
  596. <style lang="scss">
  597. %flex-center {
  598. display: flex;
  599. flex-direction: column;
  600. justify-content: center;
  601. align-items: center;
  602. }
  603. %section {
  604. display: flex;
  605. justify-content: space-around;
  606. align-content: center;
  607. background: #fff;
  608. border-radius: 10rpx;
  609. }
  610. .container {
  611. height: 100%;
  612. background-color: #ffffff;
  613. /* #ifdef APP-PLUS */
  614. .bar-height {
  615. height: var(--status-bar-height);
  616. background-color: $base-color;
  617. }
  618. /* #endif */
  619. }
  620. .content-box {
  621. height: 100%;
  622. }
  623. .user-section {
  624. height: 435rpx;
  625. padding: 60rpx 0 0 0;
  626. position: relative;
  627. .bg {
  628. position: absolute;
  629. height: 480rpx;
  630. width: 100%;
  631. left: 0;
  632. top: 0;
  633. image {
  634. width: 100%;
  635. height: 100%;
  636. }
  637. // background-color: $base-color;
  638. }
  639. }
  640. .user-box {
  641. position: relative;
  642. z-index: 0;
  643. margin: 0 auto;
  644. width: 90%;
  645. background-color: #e9f8f1;
  646. }
  647. .user-info-box {
  648. width: 100%;
  649. padding-left: 20rpx;
  650. margin: 0 auto;
  651. display: flex;
  652. align-items: stretch;
  653. border-radius: 20rpx;
  654. color: white;
  655. display: flex;
  656. justify-content: space-between;
  657. .detail {
  658. margin: 20rpx 0 0 0;
  659. height: 130rpx;
  660. .portrait-box {
  661. height: 100%;
  662. .portrait {
  663. width: 130rpx;
  664. height: 100%;
  665. border: 5rpx solid #fff;
  666. border-radius: 50%;
  667. }
  668. }
  669. .info-box {
  670. margin-left: 20rpx;
  671. line-height: 1.5;
  672. color: black;
  673. .username {
  674. font-size: $font-lg + 6rpx;
  675. height: 100%;
  676. }
  677. }
  678. }
  679. .config {
  680. margin-top: 60rpx;
  681. font-size: 28rpx;
  682. font-family: PingFang SC;
  683. font-weight: 500;
  684. color: #52c696;
  685. display: flex;
  686. justify-content: center;
  687. align-items: center;
  688. width: 165rpx;
  689. height: 64rpx;
  690. background: #ffffff;
  691. border-radius: 32px 0px 0px 32px;
  692. .setting {
  693. width: 32rpx;
  694. height: 32rpx;
  695. image {
  696. width: 100%;
  697. height: 100%;
  698. }
  699. // margin-right: 51rpx;
  700. }
  701. }
  702. }
  703. .vip-card-box {
  704. display: flex;
  705. flex-direction: column;
  706. color: #f7d680;
  707. height: 240rpx;
  708. background: linear-gradient(left, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.8));
  709. border-radius: 16rpx 16rpx 0 0;
  710. overflow: hidden;
  711. position: relative;
  712. padding: 20rpx 24rpx;
  713. .card-bg {
  714. position: absolute;
  715. top: 20rpx;
  716. right: 0;
  717. width: 380rpx;
  718. height: 260rpx;
  719. }
  720. .b-btn {
  721. position: absolute;
  722. right: 20rpx;
  723. top: 16rpx;
  724. width: 132rpx;
  725. height: 40rpx;
  726. text-align: center;
  727. line-height: 40rpx;
  728. font-size: 22rpx;
  729. color: #36343c;
  730. border-radius: 20px;
  731. background: linear-gradient(left, #f9e6af, #ffd465);
  732. z-index: 1;
  733. }
  734. .tit {
  735. font-size: $font-base + 2rpx;
  736. color: #f7d680;
  737. margin-bottom: 28rpx;
  738. .iconfont {
  739. color: #f6e5a3;
  740. margin-right: 16rpx;
  741. font-size: 30rpx;
  742. }
  743. }
  744. .e-b {
  745. font-size: $font-sm;
  746. color: #d8cba9;
  747. margin-top: 10rpx;
  748. }
  749. }
  750. .vip {
  751. margin: 0 30rpx;
  752. margin-top: -50rpx;
  753. height: 170rpx;
  754. background-image: url('../../static/user/upgrade.png');
  755. background-size: 100% 170rpx;
  756. }
  757. .cover-container {
  758. display: flex;
  759. flex-direction: column;
  760. background: $page-color-base;
  761. padding: 0 30rpx;
  762. position: relative;
  763. background: #f5f5f5;
  764. padding-bottom: 20rpx;
  765. margin-top: -110rpx;
  766. .arc {
  767. position: absolute;
  768. left: 0;
  769. top: -34rpx;
  770. width: 100%;
  771. height: 36rpx;
  772. }
  773. }
  774. .tj-sction {
  775. @extend %section;
  776. .tj-item {
  777. @extend %flex-center;
  778. flex-direction: column;
  779. height: 140rpx;
  780. font-size: $font-sm;
  781. color: #75787d;
  782. }
  783. .num {
  784. font-size: $font-lg;
  785. color: $font-color-dark;
  786. margin-bottom: 8rpx;
  787. }
  788. }
  789. .item-box {
  790. position: relative;
  791. background-color: white;
  792. top: -80rpx;
  793. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  794. .arc {
  795. position: absolute;
  796. left: 0;
  797. top: -34rpx;
  798. width: 100%;
  799. height: 36rpx;
  800. }
  801. .mendian {
  802. padding: 0 40rpx;
  803. height: 60rpx;
  804. background-color: #ffffff;
  805. display: flex;
  806. justify-content: space-between;
  807. align-items: center;
  808. margin-bottom: 20rpx;
  809. .mendian-lift {
  810. display: flex;
  811. line-height: 36rpx;
  812. .null-mendian {
  813. font-size: 28rpx;
  814. font-weight: bold;
  815. }
  816. .hym {
  817. width: 40rpx;
  818. height: 40rpx;
  819. margin-left: 10rpx;
  820. }
  821. .img {
  822. margin: 0 10rpx 0;
  823. width: 36rpx;
  824. height: 36rpx;
  825. image {
  826. width: 100%;
  827. height: 100%;
  828. }
  829. }
  830. }
  831. .mendian-right {
  832. display: flex;
  833. align-items: center;
  834. // line-height: 60rpx;
  835. .duihuan {
  836. font-size: 24rpx;
  837. }
  838. }
  839. }
  840. .my-order {
  841. width: 680rpx;
  842. margin: 40rpx auto 0;
  843. // margin-top: 10rpx;
  844. // padding: 0 20rpx;
  845. border-radius: 20rpx;
  846. box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
  847. }
  848. .box-title {
  849. line-height: 1;
  850. padding: 30rpx;
  851. .title {
  852. font-size: $font-lg;
  853. font-weight: bold;
  854. }
  855. .link {
  856. font-size: $font-base - 2rpx;
  857. color: $font-color-light;
  858. }
  859. }
  860. // .order{
  861. // margin-top: 70rpx;
  862. // }
  863. .order-section {
  864. @extend %section;
  865. padding: 40rpx 0;
  866. align-items: center;
  867. .order-item {
  868. @extend %flex-center;
  869. // width: 120rpx;
  870. width: 25%;
  871. border-radius: 10rpx;
  872. font-size: $font-sm;
  873. color: $font-color-dark;
  874. }
  875. .xian {
  876. height: 30rpx;
  877. width: 1rpx;
  878. background: #000000;
  879. }
  880. .order-num {
  881. font-size: $font-sm + 10rpx;
  882. margin-bottom: 10rpx;
  883. }
  884. .iconfont {
  885. font-size: 48rpx;
  886. margin-bottom: 18rpx;
  887. color: #fa436a;
  888. }
  889. .icon-shouhoutuikuan {
  890. font-size: 44rpx;
  891. }
  892. .icon {
  893. height: 88rpx;
  894. width: 90rpx;
  895. margin-bottom: 18rpx;
  896. background-size: 100%;
  897. background-repeat: no-repeat;
  898. background-position: center;
  899. .icon-img {
  900. width: 100%;
  901. height: 100%;
  902. }
  903. }
  904. .icon1 {
  905. height: 50rpx;
  906. width: 48rpx;
  907. margin-bottom: 18rpx;
  908. background-size: 100%;
  909. background-repeat: no-repeat;
  910. background-position: center;
  911. .icon-img {
  912. width: 100%;
  913. height: 100%;
  914. }
  915. }
  916. }
  917. }
  918. .history-section {
  919. // padding: 30rpx 0 0;
  920. margin-top: 20rpx;
  921. background: #fff;
  922. border-radius: 10rpx;
  923. .sec-header {
  924. display: flex;
  925. align-items: center;
  926. font-size: $font-base;
  927. color: $font-color-dark;
  928. line-height: 40rpx;
  929. margin-left: 30rpx;
  930. padding-top: 30rpx;
  931. .iconfont {
  932. font-size: 44rpx;
  933. color: $color-red;
  934. margin-right: 16rpx;
  935. line-height: 40rpx;
  936. }
  937. }
  938. .h-list {
  939. white-space: nowrap;
  940. padding: 30rpx 30rpx 0;
  941. image {
  942. display: inline-block;
  943. width: 160rpx;
  944. height: 160rpx;
  945. margin-right: 20rpx;
  946. border-radius: 10rpx;
  947. }
  948. }
  949. }
  950. .popup-box {
  951. width: 650rpx;
  952. padding-bottom: 30rpx;
  953. background-color: #ffffff;
  954. border-radius: 20rpx;
  955. position: relative;
  956. .img {
  957. position: relative;
  958. top: -56rpx;
  959. left: 0;
  960. width: 650rpx;
  961. height: 132rpx;
  962. z-index: 100;
  963. text-align: center;
  964. line-height: 132rpx;
  965. .img-bg {
  966. position: absolute;
  967. left: 50%;
  968. top: 0;
  969. margin-left: -250rpx;
  970. border-radius: 20rpx 20rpx 0 0;
  971. width: 500rpx;
  972. height: 132rpx;
  973. image {
  974. width: 100%;
  975. height: 100%;
  976. }
  977. }
  978. .img-font {
  979. line-height: 120rpx;
  980. position: relative;
  981. z-index: 10;
  982. text-align: center;
  983. font-size: 32rpx;
  984. font-weight: bold;
  985. color: #54300f;
  986. }
  987. }
  988. .mian {
  989. margin-top: -10rpx;
  990. display: flex;
  991. flex-direction: column;
  992. align-items: center;
  993. // padding: 32rpx 32rpx;
  994. background-color: #ffffff;
  995. border-radius: 0 0 20rpx 20rpx;
  996. text-align: center;
  997. padding: 20rpx;
  998. width: 100%;
  999. .main-item {
  1000. display: flex;
  1001. width: 580rpx;
  1002. align-items: center;
  1003. padding: 20rpx 40rpx;
  1004. border-radius: 10rpx;
  1005. background: #f5f2e5;
  1006. height: 100rpx;
  1007. .font {
  1008. color: #623324;
  1009. font-size: 30rpx;
  1010. }
  1011. .input {
  1012. margin-left: 20rpx;
  1013. text-align: left;
  1014. color: #cdc0b3;
  1015. font-size: 28rpx;
  1016. }
  1017. .input-font {
  1018. color: #cdc0b3;
  1019. font-size: 28rpx;
  1020. }
  1021. }
  1022. .comfirm-box {
  1023. margin-top: 80rpx;
  1024. display: flex;
  1025. // margin-bottom: 32rpx;
  1026. // justify-content: space-around;
  1027. .cancel {
  1028. display: flex;
  1029. align-items: center;
  1030. justify-content: center;
  1031. width: 260rpx;
  1032. height: 100rpx;
  1033. border: 1px solid #dcc786;
  1034. border-radius: 10px;
  1035. font-size: 32rpx;
  1036. color: #605128;
  1037. }
  1038. .comfirm {
  1039. margin-left: 60rpx;
  1040. display: flex;
  1041. align-items: center;
  1042. justify-content: center;
  1043. width: 260rpx;
  1044. height: 100rpx;
  1045. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  1046. border-radius: 10px;
  1047. font-size: 32rpx;
  1048. color: #605128;
  1049. }
  1050. }
  1051. }
  1052. }
  1053. .hym-wrap {
  1054. width: 500rpx;
  1055. height: 500rpx;
  1056. background-color: #fff;
  1057. text-align: center;
  1058. border-radius: 20rpx;
  1059. .hym-tit {
  1060. color: $base-color;
  1061. padding: 20rpx 0;
  1062. font-size: 48rpx;
  1063. }
  1064. .hym-val {
  1065. width: 300rpx;
  1066. height: 300rpx;
  1067. margin: auto;
  1068. }
  1069. .hym-num {
  1070. font-size: 28rpx;
  1071. font-weight: bold;
  1072. padding-top: 20rpx;
  1073. }
  1074. }
  1075. .sy-box {
  1076. height: 148rpx;
  1077. // background-color: #bfa;
  1078. .sy-item {
  1079. width: 30%;
  1080. flex-grow: 1;
  1081. text-align: center;
  1082. font-size: 24rpx;
  1083. font-family: PingFang SC;
  1084. font-weight: 500;
  1085. color: #3bbc88;
  1086. .sy-item-val {
  1087. margin-top: 6rpx;
  1088. font-size: 28rpx;
  1089. }
  1090. .sy-item-name {
  1091. color: #000000;
  1092. }
  1093. }
  1094. .jg {
  1095. width: 2rpx;
  1096. height: 40rpx;
  1097. background-color: #d4ded8;
  1098. }
  1099. }
  1100. </style>