user.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. <template>
  2. <view class="user-index" :class="['qn-page-' + theme]">
  3. <view class="user-top" :style="{ height: vip_data.name ? '418rpx' : '348rpx' }">
  4. <!-- 装饰 -->
  5. <view class="circle-big" :style="{ height: vip_data.name ? '418rpx' : '348rpx' }">
  6. <view class="circle-one"></view>
  7. <view class="circle-two"></view>
  8. <view class="vip-view clearfix" v-if="vip_data.name">
  9. <view class="float_left">
  10. <view class="vip-name">
  11. <text class="ibonfont ibonhuiyuan" style="margin-right: 16rpx;"></text>
  12. {{ vip_data.name }}
  13. </view>
  14. <view class="desc" v-if="vip_data.vipDiscount === 5">享受全场{{ vip_data.discount - 0 }}折</view>
  15. <view class="desc" v-else>专享会员权益</view>
  16. </view>
  17. <view class="float_right vip-btn" @click="navTo(`/pagesT/user/VipDetail?id=${vip_data.id}`)">
  18. <block v-if="vip_data.isSelf">立即查看</block>
  19. <block v-else>立即开通</block>
  20. </view>
  21. </view>
  22. </view>
  23. <uniStatusBar />
  24. <!-- 未登录 -->
  25. <view class="user-info clearfix" v-if="!isLogin">
  26. <view class="ui-img float_left">
  27. <u-image shape="circle" width="120rpx" height="120rpx" error-icon="photo"
  28. src="https://onlineimg.qianniao.vip/user-re.png"></u-image>
  29. </view>
  30. <view class="user-name float_left" style="padding-top: 20rpx;">
  31. <Login @loginSuccess="loginSuccess">
  32. <view class="login-btn" slot="lBtn">登录/注册</view>
  33. </Login>
  34. </view>
  35. <view class="float_right right-icon" @click="setUserInfo">
  36. <view><text class="ibonfont ibonshezhi21"></text></view>
  37. <view class="text">设置</view>
  38. </view>
  39. </view>
  40. <!-- 已登录 -->
  41. <view class="user-info clearfix" v-else>
  42. <view class="ui-img float_left" @click="setUserInfo">
  43. <u-image error-icon="photo" shape="circle" width="120rpx" height="120rpx" :src="userInfo.avatar">
  44. </u-image>
  45. <view class="edit-bth">{{ userStatus === 0 ? '去完善' : '编辑' }}</view>
  46. </view>
  47. <view class="user-name float_left">
  48. <view class="un-text ellipsis" v-if="userInfo.name">{{ userInfo.name || '匿名用户' }}</view>
  49. <view class="un-text-desc"
  50. v-if="(personnelReview === 5 || finishData === 5) && (userStatus !== 2 || enableStatus === 4)">
  51. <text v-if="enableStatus === 4">已禁用</text>
  52. <text v-else-if="userStatus === 0">待完善资料</text>
  53. <text v-else-if="userStatus === 1">审核中</text>
  54. <text v-else-if="userStatus === 3">已驳回,请重新完善资料</text>
  55. </view>
  56. <view class="un-text-desc" v-else>
  57. <text class="customer-type-name">{{ userInfo.customerSourceTypeName || '默认类型' }}</text>
  58. </view>
  59. <view class="un-text-desc" style="margin-left: 20rpx;" v-if="vip_data.isSelf"><text
  60. class="customer-type-name">VIP会员</text></view>
  61. </view>
  62. <view class="float_right right-icon" @click="setUserInfo">
  63. <view><text class="ibonfont ibonshezhi21"></text></view>
  64. <view class="text">设置</view>
  65. </view>
  66. </view>
  67. <block v-if="personnelReview === 5 && userStatus === 3">
  68. <u-notice-bar mode="horizontal" :list="['审核失败,原因:' + userInfo.auditFailReason]" :speed="100"
  69. :volume-icon="false" :more-icon="true"></u-notice-bar>
  70. </block>
  71. </view>
  72. <view class="num-view" v-if="isLogin">
  73. <view class="num-li" v-if="en_token !== aier_en_token" @click="navTo('/pagesT/money/Balance')">
  74. <view class="num-text">{{ Number(userInfo.memberBalance) || 0 }}</view>
  75. <view class="num-tit">余额</view>
  76. </view>
  77. <view class="num-li" @click="navTo('/pagesT/pointsMall/index')">
  78. <view class="num-text">{{ userInfo.integral || 0 }}</view>
  79. <view class="num-tit">股权</view>
  80. </view>
  81. <view class="num-li" @click="navTo('/pagesT/user/DiscountCoupon')">
  82. <view class="num-text">{{ userInfo.couponNum || 0 }}</view>
  83. <view class="num-tit">优惠券</view>
  84. </view>
  85. <view class="num-li" @click="navTo('/pagesT/user/Collection')">
  86. <view class="num-text">{{ userInfo.collNum || 0 }}</view>
  87. <view class="num-tit">收藏</view>
  88. </view>
  89. </view>
  90. <view class="model-view">
  91. <view class="model-tit clearfix">
  92. <view class="float_left">我的订单</view>
  93. <view class="float_right" @click="navTo('/pagesT/order/order?state=0')">
  94. <text>查看全部</text>
  95. <text class="ibonfont ibonjinru"></text>
  96. </view>
  97. </view>
  98. <view class="model-main fn-ul order-ul">
  99. <view class="fn-li" @click="navTo('/pagesT/order/order?state=' + 1)">
  100. <u-badge v-if="order_num['2'] > 0 && isLogin" type="error" :offset="[-16, 18]"
  101. :count="order_num['2']"></u-badge>
  102. <view class="fn-icon">
  103. <image :src="'https://onlineimg.qianniao.vip/ic-dfk-' + theme + '.png'"></image>
  104. </view>
  105. <view class="fn-label">待付款</view>
  106. </view>
  107. <view class="fn-li" @click="navTo('/pagesT/order/order?state=' + 2)">
  108. <u-badge v-if="order_num['3'] > 0 && isLogin" type="error" :offset="[-16, 18]"
  109. :count="order_num['3']"></u-badge>
  110. <view class="fn-icon">
  111. <image :src="'https://onlineimg.qianniao.vip/ic-dfh-' + theme + '.png'"></image>
  112. </view>
  113. <view class="fn-label">待发货</view>
  114. </view>
  115. <view class="fn-li" @click="navTo('/pagesT/order/order?state=' + 3)">
  116. <u-badge v-if="order_num['4'] > 0 && isLogin" type="error" :offset="[-16, 18]"
  117. :count="order_num['4']"></u-badge>
  118. <view class="fn-icon">
  119. <image :src="'https://onlineimg.qianniao.vip/ic-dsh-' + theme + '.png'"></image>
  120. </view>
  121. <view class="fn-label">待收货</view>
  122. </view>
  123. <view class="fn-li" @click="navTo('/pagesT/order/order?state=' + 4)">
  124. <u-badge v-if="order_num['5'] > 0 && isLogin" type="error" :offset="[-16, 18]"
  125. :count="order_num['5']"></u-badge>
  126. <view class="fn-icon">
  127. <image :src="'https://onlineimg.qianniao.vip/ic-finish-' + theme + '.png'"></image>
  128. </view>
  129. <view class="fn-label">已完成</view>
  130. </view>
  131. <!-- <view class="fn-li" v-if="en_token !== aier_en_token" @click="navTo('/pagesT/order/ReturnOrder')">
  132. <u-badge v-if="order_num['10'] > 0 && isLogin" type="error" :offset="[-16, 18]" :count="order_num['10']"></u-badge>
  133. <view class="fn-icon"><image :src="'https://onlineimg.qianniao.vip/ic-service-' + theme + '.png'"></image></view>
  134. <view class="fn-label">售后服务</view>
  135. </view> -->
  136. </view>
  137. </view>
  138. <!-- 负责代表信息 -->
  139. <!-- <view class="model-view" v-if="isLogin">
  140. <view class="information-top">
  141. <image src="https://onlineimg.qianniao.vip/ic-db.png" class="img"></image>
  142. <view class="text">负责代表信息</view>
  143. </view>
  144. <view class="information-bottom">
  145. <ul class="ul-list">
  146. <li class="ul-item ellipsis">
  147. <text class="left">出货门店:</text>
  148. <text class="right">{{ userInfo.shopDate.name }}</text>
  149. </li>
  150. <li class="ul-item">
  151. <text class="left">业代姓名:</text>
  152. <text class="right">{{ userInfo.salesManName || '客服' }}</text>
  153. </li>
  154. <li class="ul-item">
  155. <text class="left">服务时间:</text>
  156. <text class="right">全天</text>
  157. </li>
  158. <li class="ul-item">
  159. <text class="left">门店电话:</text>
  160. <text class="right right-last" @click="lianxi(userInfo.salesManMobile || userInfo.shopDate.mobile)">
  161. {{ userInfo.salesManMobile || userInfo.shopDate.mobile }}
  162. </text>
  163. </li>
  164. </ul>
  165. </view>
  166. </view> -->
  167. <view class="model-view" v-if="en_token !== aier_en_token">
  168. <view class="model-tit">我的服务</view>
  169. <view class="model-main fn-ul">
  170. <!-- <view class="fn-li" @click="navTo('/pagesT/user/VipList')">
  171. <view class="fn-icon"><image :src="'https://onlineimg.qianniao.vip/ic-vip-' + theme + '.png'"></image></view>
  172. <view class="fn-label">会员卡</view>
  173. </view> -->
  174. <view class="fn-li" @click="navTo('/pagesT/user/dyquan')">
  175. <view class="fn-icon">
  176. <image src="https://api.junhailan.com/img/user/dyq.png"></image>
  177. </view>
  178. <view class="fn-label">我的优惠卡</view>
  179. </view>
  180. <view class="fn-li" @click="navTo('/pagesT/address/address')">
  181. <view class="fn-icon">
  182. <image src="https://api.junhailan.com/img/user/wddz.png"></image>
  183. </view>
  184. <view class="fn-label">我的地址</view>
  185. </view>
  186. <!-- <view class="fn-li" @click="navTo('/pagesT/user/myyhk')">
  187. <view class="fn-icon">
  188. <image src="https://api.junhailan.com/img/user/yhk.png"></image>
  189. </view>
  190. <view class="fn-label">我的优惠卡</view>
  191. </view> -->
  192. <!-- <view class="fn-li" @click="goDistribution">
  193. <view class="fn-icon">
  194. <image :src="'https://onlineimg.qianniao.vip/ic-fen-' + theme + '.png'"></image>
  195. </view>
  196. <view class="fn-label">分销中心</view>
  197. </view> -->
  198. <view class="fn-li" @click="navTo('/pagesT/user/Collection')">
  199. <view class="fn-icon">
  200. <image src="https://api.junhailan.com/img/user/wdsc.png"></image>
  201. </view>
  202. <view class="fn-label">我的收藏</view>
  203. </view>
  204. </view>
  205. </view>
  206. <view class="model-view list-model-view">
  207. <view class="model-tit">工具与服务</view>
  208. <view class="model-main list-ul new-class">
  209. <view class="list-li clearfix" @click="openpop">
  210. <view class="fn-icon">
  211. <image src="https://api.junhailan.com/img/user/ic-kf.png" mode="aspectFill"></image>
  212. <view>{{ userInfo.salesManName ? '专属客服' : '客服中心' }}</view>
  213. </view>
  214. </view>
  215. <!-- <view class="list-li clearfix" v-if="en_token === aier_en_token" @click="navTo('/pagesT/address/address')">
  216. <view class="fn-icon">
  217. <image src="https://onlineimg.qianniao.vip/ic-dz.png" mode="aspectFill"></image>
  218. <view>我的地址</view>
  219. </view>
  220. </view> -->
  221. <!-- <view class="list-li clearfix" v-if="en_token === aier_en_token" @click="navTo('/pagesT/money/CustomerBalanceDetail')">
  222. <view class="fn-icon">
  223. <image src="https://onlineimg.qianniao.vip/ic-3.png" mode="aspectFill"></image>
  224. <view>往来查询</view>
  225. </view>
  226. </view> -->
  227. <view class="list-li clearfix" @click="navTo('/pagesT/unit/yhk')">
  228. <view class="fn-icon">
  229. <image src="https://api.junhailan.com/img/user/hyk.png" mode="aspectFill"></image>
  230. <view>会员项目</view>
  231. </view>
  232. </view>
  233. <view class="list-li clearfix" @click="navTo('/pagesT/user/GetCoupon')">
  234. <view class="fn-icon">
  235. <image src="https://api.junhailan.com/img/user/lqzx.png" mode="aspectFill"></image>
  236. <view>领券中心</view>
  237. </view>
  238. </view>
  239. <view class="list-li clearfix" @click="navTo('/pagesT/order/orderT?state=1')">
  240. <view class="fn-icon">
  241. <image src="https://api.junhailan.com/img/user/cgqd.png" mode="aspectFill"></image>
  242. <view>我的预约</view>
  243. </view>
  244. </view>
  245. <view class="list-li clearfix" @click="navTo('/pagesT/user/needSubmit')">
  246. <view class="fn-icon">
  247. <image src="https://api.junhailan.com/img/user/xqtb.png" mode="aspectFill"></image>
  248. <view>需求提报</view>
  249. </view>
  250. </view>
  251. <!-- <view class="list-li clearfix" @click="navTo('/pagesT/user/guquan')">
  252. <view class="fn-icon">
  253. <image src="https://api.junhailan.com/img/user/gq.png" mode="aspectFill"></image>
  254. <view>股份</view>
  255. </view>
  256. </view> -->
  257. <!-- #ifdef MP -->
  258. <view class="list-li">
  259. <button class="clearfix share-btn" open-type="share">
  260. <view class="fn-icon">
  261. <image src="https://api.junhailan.com/img/user/tjfx.png" mode="aspectFill"></image>
  262. <view class="share">推荐分享</view>
  263. </view>
  264. </button>
  265. </view>
  266. <!-- #endif -->
  267. <!-- #ifdef APP-PLUS -->
  268. <!-- <view class="list-li clearfix" @click="share">
  269. <view class="fn-icon">
  270. <image src="https://onlineimg.qianniao.vip/ic-5.png" mode="aspectFill"></image>
  271. <view>推荐分享</view>
  272. </view>
  273. </view> -->
  274. <!-- <view class="list-li clearfix" @click="share">
  275. <view class="float_left">
  276. <view class="fn-icon"><image src="https://onlineimg.qianniao.vip/ic-5.png" mode="aspectFill"></image></view>
  277. <text>推荐分享</text>
  278. </view>
  279. <view class="float_right"><text class="ibonfont ibonjinru"></text></view>
  280. </view> -->
  281. <!-- #endif -->
  282. <view class="list-li clearfix" v-if="en_token !== aier_en_token" @click="setUserInfo">
  283. <view class="fn-icon">
  284. <image src="https://api.junhailan.com/img/user/sz.png" mode="aspectFill"></image>
  285. <view>设置</view>
  286. </view>
  287. </view>
  288. </view>
  289. </view>
  290. <u-modal v-model="show_change_name" @confirm="nameCofirm" @cancel="nameCancel" :show-cancel-button="true"
  291. content="您的昵称为小程序默认昵称,是否立即修改" confirm-text="去修改" cancel-text="下次再说"></u-modal>
  292. <u-modal v-model="tip_model" @confirm="finishCofirm" @cancel="tipCancel" :show-cancel-button="true"
  293. content="请先完善资料,再进行购物" confirm-text="去完善" cancel-text="逛逛商城"></u-modal>
  294. <Tabbar v-model="current"></Tabbar>
  295. <u-popup v-model="call_show" width="600rpx" mode="center" border-radius="20">
  296. <view class="call-pop">
  297. <view class="title">
  298. <text>专属客户经理</text>
  299. <view class="close-icon" @click="cancalCall">
  300. <u-icon name="close" size="28" color="#6c6c6c"></u-icon>
  301. </view>
  302. </view>
  303. <view class="call-ul">
  304. <view class="call-li">
  305. <text class="label">客户经理:</text>
  306. <text class="value">{{ userInfo.salesManName }}</text>
  307. </view>
  308. <view class="call-li">
  309. <text class="label">联系方式:</text>
  310. <text class="value">{{ userInfo.salesManMobile }}</text>
  311. </view>
  312. </view>
  313. <view class="call-btn primary-btn" @click="lianxi(userInfo.salesManMobile)">一键通话</view>
  314. </view>
  315. </u-popup>
  316. </view>
  317. </template>
  318. <script>
  319. import Login from '@/components/Login.vue';
  320. import uniStatusBar from '@/components/uni-status-bar/uni-status-bar.vue';
  321. import {
  322. getEnToken,
  323. getToken
  324. } from '@/access/common.js';
  325. export default {
  326. components: {
  327. Login,
  328. uniStatusBar
  329. },
  330. // 下拉刷新
  331. onPullDownRefresh() {
  332. if (this.$store.state.hasLogin) {
  333. this.getCustomerInfo();
  334. this.getMyVipCards();
  335. // 获取分销文字设置
  336. this.getTxtSetting();
  337. this.getDistributionSetting();
  338. } else {
  339. uni.stopPullDownRefresh();
  340. }
  341. },
  342. data() {
  343. return {
  344. kefu_phone: '',
  345. tip_model: false,
  346. show_change_name: false,
  347. call_show: false,
  348. current: 3,
  349. distributionSet: {},
  350. userInfo: {},
  351. avatar: '',
  352. vip_data: {},
  353. vip_num: 0,
  354. // 爱尔
  355. aier_en_token: '8ecdecee648713391dc144f29bea5ca7',
  356. en_token: getEnToken(),
  357. order_num: {}
  358. };
  359. },
  360. watch: {
  361. '$store.state.locationObj'(val) {
  362. if (JSON.stringify(val) === '{}') {
  363. this.getAuthorizeInfo();
  364. return;
  365. }
  366. if (this.$store.state.hasLogin) {
  367. this.getCustomerInfo();
  368. }
  369. },
  370. isLogin(val) {
  371. if (val) {
  372. // 获取用户详情
  373. this.getCustomerInfo();
  374. // 获取分销文字设置
  375. this.getTxtSetting();
  376. // 获取分销基础设置
  377. this.getDistributionSetting();
  378. this.getOrderStatusNum();
  379. } else {
  380. this.vip_data = {};
  381. }
  382. }
  383. },
  384. computed: {
  385. // 业代姓名
  386. salesManName() {
  387. if (this.$store.state.userStatus.salesManName) {
  388. return this.$store.state.userStatus.salesManName;
  389. } else {
  390. return '客服';
  391. }
  392. },
  393. // 门店电话
  394. salesManMobile() {
  395. if (this.$store.state.userStatus.salesManMobile) {
  396. return this.$store.state.userStatus.salesManMobile;
  397. } else {
  398. return this.$store.state.userStatus.enterpriseMobile;
  399. }
  400. },
  401. // 门店
  402. enterpriseName() {
  403. return this.$store.state.enterpriseInfo.enterpriseName;
  404. },
  405. baseSet() {
  406. return this.$store.state.baseSet;
  407. },
  408. enterprisemobile() {
  409. return this.$store.state.enterpriseInfo.mobile;
  410. },
  411. isLogin() {
  412. return this.$store.state.hasLogin;
  413. },
  414. // 客户审核
  415. personnelReview() {
  416. return this.baseSet.personnelReview;
  417. },
  418. userStatus() {
  419. return this.$store.state.userStatus.status;
  420. },
  421. enableStatus() {
  422. return this.$store.state.userStatus.enableStatus;
  423. },
  424. // 完善资料 4禁用 5启用
  425. finishData() {
  426. return this.baseSet.finishData;
  427. }
  428. },
  429. onLoad() {
  430. this.getSh()
  431. if (JSON.stringify(this.$store.state.locationObj) === '{}') {
  432. this.getAuthorizeInfo();
  433. return;
  434. }
  435. if (this.$store.state.hasLogin) {
  436. // 获取分销文字设置
  437. this.getTxtSetting();
  438. // 获取分销基础设置
  439. this.getDistributionSetting();
  440. // this.avatar = this.$common.getAvator();
  441. }
  442. // #ifdef MP-WEIXIN
  443. // 小程序的原生菜单中显示分享按钮
  444. uni.showShareMenu({
  445. withShareTicket: false,
  446. menus: ['shareAppMessage', 'shareTimeline']
  447. });
  448. // #endif
  449. },
  450. onShow() {
  451. if (this.$store.state.hasLogin) {
  452. // 获取用户详情
  453. this.getCustomerInfo();
  454. this.getOrderStatusNum();
  455. }
  456. },
  457. methods: {
  458. getSh() {
  459. this.$u.api.getBasicField({'field': ["phone"]}).then(({data})=> {
  460. // this.shenhe = data/
  461. // console.log(data);
  462. // this.shenhe = data.shenhe
  463. this.kefu_phone = data.phone
  464. })
  465. },
  466. // #ifdef APP-PLUS
  467. share() {
  468. uni.share({
  469. provider: 'weixin',
  470. scene: 'WXSceneSession',
  471. type: 5,
  472. title: this.baseSet.shop,
  473. imageUrl: this.baseSet.images,
  474. success: function(res) {
  475. console.log('success:' + JSON.stringify(res));
  476. },
  477. fail: function(err) {
  478. console.log('fail:' + JSON.stringify(err));
  479. }
  480. });
  481. },
  482. // #endif
  483. // 设置用户信息
  484. setUserInfo() {
  485. if (!(this.finishData === 5 && this.userInfo.status !== 2)) {
  486. this.navTo('/pagesT/selfconfig/selfconfig');
  487. } else {
  488. this.navTo('/pagesT/user/editUserInfo');
  489. }
  490. },
  491. loginSuccess() {
  492. // this.isLogin = this.$store.state.hasLogin;
  493. // this.getCustomerInfo();
  494. // this.getMyVipCards();
  495. },
  496. /**
  497. * 统一跳转接口,拦截未登录路由
  498. * navigator标签现在默认没有转场动画,所以用view
  499. */
  500. navTo(url) {
  501. // console.log(this.hasLogin)
  502. // return
  503. if (!this.$store.state.hasLogin) {
  504. // #ifdef APP-PLUS
  505. uni.reLaunch({
  506. url: '/pagesT/public/wxLogin'
  507. });
  508. // #endif
  509. // #ifdef MP-WEIXIN
  510. uni.reLaunch({
  511. url: '/pagesT/binding/bindInfo'
  512. });
  513. //#endif
  514. // #ifdef H5
  515. uni.navigateTo({
  516. url: '/pagesT/public/wxLogin?loginType=2'
  517. });
  518. // #endif
  519. } else {
  520. uni.navigateTo({
  521. url
  522. });
  523. }
  524. },
  525. async goDistribution() {
  526. if (!this.$store.state.hasLogin) {
  527. // #ifdef APP-PLUS || H5
  528. uni.reLaunch({
  529. url: '/pagesT/public/wxLogin'
  530. });
  531. // #endif
  532. // #ifdef MP-WEIXIN
  533. uni.reLaunch({
  534. url: '/pagesT/binding/bindInfo'
  535. });
  536. //#endif
  537. } else {
  538. this.getInfoBusinessman();
  539. // console.log(this.distributionSet.level,'this.distributionSet.level');
  540. // if (this.distributionSet.level && this.distributionSet.level > 0) {
  541. // this.getInfoBusinessman();
  542. // } else {
  543. // this.$api.msg('抱歉,当前商家暂未开启分销功能');
  544. // }
  545. }
  546. },
  547. // 获取文字设置
  548. async getTxtSetting() {
  549. this.$u.api.getTxtSetting().then(({
  550. data
  551. }) => {
  552. this.$store.commit('commit_distributionTextSet', data.base_form || {});
  553. });
  554. },
  555. // 获取分销商详情
  556. async getInfoBusinessman() {
  557. if (this.userInfo.status !== 2) {
  558. this.$api.msg('抱歉,您的账号未通过审核');
  559. return;
  560. }
  561. this.$u.api.getInfoBusinessman().then(({
  562. data
  563. }) => {
  564. if (JSON.stringify(data) === '{}') {
  565. // 不是分销商进入申请分销商页面
  566. this.goPage('/pagesT/Distribution/ApplyTerm');
  567. } else {
  568. if (data.auditStatus === 2) {
  569. // 进入分销中心页面
  570. this.goPage('/pagesT/Distribution/Distribution');
  571. } else {
  572. this.goPage('/pagesT/Distribution/ApplyAudit?auditStatus=1&applicationCondition=' +
  573. data.applicationCondition);
  574. }
  575. }
  576. });
  577. },
  578. getDistributionSetting() {
  579. this.$u.api.getDistributionSetting().then(({
  580. data
  581. }) => {
  582. this.$store.commit('commit_distributionSet', data);
  583. this.distributionSet = data;
  584. });
  585. },
  586. // 获取我的会员卡
  587. getMyVipCards() {
  588. this.$u.api
  589. .getMyVipCards({
  590. page: 1,
  591. pageSize: 1
  592. })
  593. .then(({
  594. data,
  595. pageTotal
  596. }) => {
  597. if (data.length) {
  598. this.vip_num = pageTotal;
  599. this.vip_data = {
  600. ...data[0],
  601. isSelf: true
  602. };
  603. } else {
  604. this.getAllVipCard();
  605. }
  606. });
  607. },
  608. // 获取会员列表
  609. getAllVipCard() {
  610. this.$u.api
  611. .getAllVipCard({
  612. page: 1,
  613. pageSize: 1
  614. })
  615. .then(({
  616. data
  617. }) => {
  618. if (data.length) {
  619. this.vip_data = data[0];
  620. }
  621. });
  622. },
  623. //用户订单状态数量统计
  624. getOrderStatusNum() {
  625. this.$u.api.getOrderStatusNum().then(res => {
  626. this.order_num = res.data;
  627. });
  628. },
  629. // 获取用户信息
  630. getCustomerInfo() {
  631. this.$u.api.getCustomerInfo().then(({
  632. data
  633. }) => {
  634. uni.stopPullDownRefresh();
  635. this.userInfo = data;
  636. if (this.userInfo.status === 2) {
  637. this.getMyVipCards();
  638. }
  639. this.$store.commit('commit_userStatus', data);
  640. if (this.baseSet.finishDataGo && data.status === 0) {
  641. this.tip_model = true;
  642. }
  643. if (this.userInfo.name == '微信用户') {
  644. let show = uni.getStorageSync('showchangename')
  645. if (show != 1) {
  646. this.show_change_name = true
  647. }
  648. }
  649. });
  650. },
  651. // 联系客服
  652. async lianxi(phone) {
  653. this.cancalCall();
  654. uni.makePhoneCall({
  655. phoneNumber: phone || this.enterprisemobile
  656. });
  657. },
  658. cancalCall() {
  659. this.call_show = false;
  660. },
  661. openpop() {
  662. if (this.userInfo.salesManName) {
  663. // this.call_show = true;
  664. this.lianxi(this.kefu_phone)
  665. } else {
  666. // this.lianxi(this.enterprisemobile);
  667. // this.lianxi('17350663338');
  668. this.lianxi(this.kefu_phone)
  669. }
  670. },
  671. // 完善资料提示取消
  672. tipCancel() {
  673. this.tip_model = false;
  674. },
  675. nameCancel() {
  676. uni.setStorageSync('showchangename', 1)
  677. this.show_change_name = false;
  678. },
  679. // 跳转完善资料页面
  680. finishCofirm() {
  681. this.goPage('/pagesT/user/editUserInfo');
  682. },
  683. nameCofirm() {
  684. uni.setStorageSync('showchangename', 1)
  685. this.goPage('/pagesT/selfconfig/selfconfig');
  686. },
  687. },
  688. onShareAppMessage(options) {
  689. return {
  690. title: this.$store.state.baseSet.shop,
  691. path: '/pages/index/index?businessmanId=' + (this.$store.state.userStatus.id || ''),
  692. success: res => {
  693. console.log(res);
  694. }
  695. };
  696. },
  697. // #ifdef MP-WEIXIN
  698. // 分享到朋友圈
  699. onShareTimeline(obj) {},
  700. // 收藏小程序
  701. onAddToFavorites() {}
  702. // #endif
  703. };
  704. </script>
  705. <style lang="scss">
  706. page {
  707. background-color: #ffffff;
  708. }
  709. .user-index {
  710. overflow-x: hidden;
  711. width: 750upx;
  712. }
  713. .user-top {
  714. color: #ffffff;
  715. position: relative;
  716. width: 100%;
  717. height: 418rpx;
  718. overflow: hidden;
  719. .circle-big {
  720. content: '';
  721. display: block;
  722. width: 180%;
  723. height: 418rpx;
  724. position: absolute;
  725. left: 50%;
  726. transform: translateX(-50%);
  727. top: 0;
  728. overflow: hidden;
  729. border-radius: 0 0 50% 50%;
  730. background: linear-gradient(156deg, #ff6b2c 0%, #ec2723 100%);
  731. .circle-one {
  732. position: absolute;
  733. top: 0;
  734. left: 20%;
  735. border-bottom-right-radius: 100%;
  736. width: 557rpx;
  737. height: 60rpx;
  738. background: linear-gradient(180deg, rgba(255, 60, 58, 0.62) 10%, #ff6d2f 100%);
  739. }
  740. .circle-two {
  741. width: 155rpx;
  742. height: 155rpx;
  743. background: linear-gradient(211deg, #ff8d33 0%, #ff633b 62%);
  744. border-radius: 100%;
  745. position: absolute;
  746. bottom: -12rpx;
  747. left: 19%;
  748. }
  749. .vip-view {
  750. width: 670upx;
  751. padding: 26rpx 40rpx;
  752. height: 98rpx;
  753. border-radius: 15rpx;
  754. background: linear-gradient(90deg, #8e0e15 0%, #550609 100%);
  755. border-top: 4rpx solid rgba(255, 219, 153, 1);
  756. color: #ffe285;
  757. z-index: 1;
  758. position: absolute;
  759. bottom: 0;
  760. left: 50%;
  761. transform: translateX(-50%);
  762. overflow: hidden;
  763. .vip-name {
  764. display: inline-block;
  765. font-size: 32rpx;
  766. font-weight: 500;
  767. }
  768. .desc {
  769. font-size: 28rpx;
  770. font-weight: 400;
  771. margin-left: 16rpx;
  772. display: inline-block;
  773. }
  774. .vip-btn {
  775. width: 140rpx;
  776. font-size: 24rpx;
  777. font-weight: 400;
  778. height: 42rpx;
  779. background: linear-gradient(90deg, #ffbf59 0%, #ff3b2d 100%);
  780. border-radius: 21rpx;
  781. color: #ffefc5;
  782. text-align: center;
  783. line-height: 42rpx;
  784. }
  785. }
  786. }
  787. .user-info {
  788. padding: 0 40rpx;
  789. padding-top: 80rpx;
  790. position: relative;
  791. z-index: 9;
  792. .ui-img {
  793. border-radius: 100%;
  794. border: 4upx solid #ffffff;
  795. position: relative;
  796. .edit-bth {
  797. position: absolute;
  798. width: 86rpx;
  799. height: 32rpx;
  800. background: #b620e0;
  801. border-radius: 16rpx;
  802. text-align: center;
  803. font-size: 20rpx;
  804. line-height: 32rpx;
  805. left: 50%;
  806. transform: translateX(-50%);
  807. bottom: -8rpx;
  808. }
  809. }
  810. .right-icon {
  811. text-align: center;
  812. padding-top: 22rpx;
  813. .ibonfont {
  814. font-size: 40rpx;
  815. }
  816. .text {
  817. font-size: 20rpx;
  818. font-weight: 400;
  819. color: #ffffff;
  820. line-height: 28rpx;
  821. margin-top: 9rpx;
  822. }
  823. }
  824. .user-name {
  825. font-size: 32upx;
  826. padding-left: 10upx;
  827. margin-top: 14rpx;
  828. width: 450rpx;
  829. .login-btn {
  830. color: #fff;
  831. font-size: 32rpx;
  832. width: 100%;
  833. text-align: left;
  834. }
  835. .un-text {
  836. -webkit-line-clamp: 1;
  837. }
  838. .un-text-desc {
  839. float: left;
  840. font-size: 20upx;
  841. margin-top: 12rpx;
  842. width: 120rpx;
  843. height: 36rpx;
  844. line-height: 36rpx;
  845. text-align: center;
  846. background: rgba(255, 139, 130, 0.38);
  847. border-radius: 18rpx;
  848. }
  849. .ulogin-bth {
  850. text-align: left;
  851. height: 46upx;
  852. line-height: 46upx;
  853. border-radius: 46upx;
  854. padding: 0;
  855. color: #ffffff;
  856. float: left;
  857. background-color: transparent;
  858. margin-top: 20upx;
  859. &::after {
  860. border: 0 none;
  861. }
  862. }
  863. }
  864. }
  865. }
  866. .num-view {
  867. display: flex;
  868. padding-bottom: 10upx;
  869. border-bottom: 16rpx solid #f9f9f9;
  870. padding: 30rpx 0;
  871. .num-li {
  872. flex: 4;
  873. text-align: center;
  874. position: relative;
  875. .num-text {
  876. font-size: 32upx;
  877. font-weight: 600;
  878. padding-bottom: 10upx;
  879. font-family: DIN-Medium;
  880. }
  881. .num-tit {
  882. font-size: 24upx;
  883. font-weight: 400;
  884. }
  885. &::after {
  886. content: '';
  887. display: block;
  888. position: absolute;
  889. width: 1px;
  890. height: 40upx;
  891. background-color: #ffffff;
  892. right: 0;
  893. top: 50%;
  894. transform: translateY(-50%);
  895. }
  896. }
  897. .num-li:last-child {
  898. &::after {
  899. background-color: transparent;
  900. }
  901. }
  902. }
  903. .model-view {
  904. border-bottom: 16rpx solid #f9f9f9;
  905. border-radius: 12upx;
  906. padding-bottom: 40upx;
  907. background-color: #ffffff;
  908. position: relative;
  909. z-index: 1;
  910. .information-bottom {
  911. // width: 750rpx;
  912. height: 100rpx;
  913. text-align: center;
  914. padding-left: 48rpx;
  915. .ul-list {
  916. display: flex;
  917. flex-wrap: wrap;
  918. margin-top: 32rpx;
  919. .ul-item {
  920. text-align: left;
  921. width: 50%;
  922. -webkit-line-clamp: 1;
  923. &:nth-child(3),
  924. &:nth-child(4) {
  925. margin-top: 24rpx;
  926. }
  927. .left {
  928. font-size: 24rpx;
  929. line-height: 33rpx;
  930. color: #9d9d9d;
  931. font-weight: 500;
  932. }
  933. .right {
  934. font-size: 24rpx;
  935. line-height: 33rpx;
  936. color: #000000;
  937. font-weight: 600;
  938. }
  939. .right-last {
  940. color: #fa6400;
  941. font-weight: 600;
  942. }
  943. }
  944. }
  945. }
  946. // 负责信息
  947. .information-top {
  948. // width:750rpx ;
  949. height: 72rpx;
  950. background: url(https://onlineimg.qianniao.vip/bck.png) no-repeat;
  951. background-position: -24rpx 0, 0 0;
  952. background-size: 800rpx 99rpx;
  953. padding-top: 17rpx;
  954. .img {
  955. display: inline-block;
  956. width: 33rpx;
  957. height: 33rpx;
  958. vertical-align: middle;
  959. margin-left: 56rpx;
  960. }
  961. .text {
  962. font-size: 32rpx;
  963. font-weight: 600;
  964. color: #2a2a2a;
  965. line-height: 45rpx;
  966. vertical-align: middle;
  967. display: inline-block;
  968. margin-left: 6rpx;
  969. }
  970. }
  971. .model-tit {
  972. padding: 32upx;
  973. font-size: 32rpx;
  974. font-weight: 600;
  975. color: #000000;
  976. .float_right {
  977. font-size: 28upx;
  978. color: #9d9d9d;
  979. font-weight: 400;
  980. .ibonjinru {
  981. margin-left: 10upx;
  982. font-size: 24upx;
  983. }
  984. }
  985. }
  986. .list-ul {
  987. padding: 0 30upx;
  988. display: flex;
  989. flex-wrap: wrap;
  990. .list-li {
  991. line-height: 90upx;
  992. font-size: 28upx;
  993. color: #2a2a2a;
  994. width: 25%;
  995. text-align: center;
  996. .fn-icon {
  997. // margin-right: 24upx;
  998. // display: inline-block;
  999. text-align: center;
  1000. .share {
  1001. line-height: 95rpx;
  1002. padding-left: 8rpx;
  1003. }
  1004. image {
  1005. width: 89rpx;
  1006. height: 89rpx;
  1007. vertical-align: middle;
  1008. transform: translateY(3rpx); // width: 50upx;
  1009. // height: 50upx;
  1010. // vertical-align: middle;
  1011. // transform: translateY(-2upx);
  1012. }
  1013. }
  1014. .ibonjinru {
  1015. font-size: 28upx;
  1016. color: #9d9d9d;
  1017. }
  1018. .share-btn {
  1019. background-color: #ffffff;
  1020. font-size: 28rpx;
  1021. padding-left: 0;
  1022. padding-right: 0;
  1023. padding-top: 2rpx;
  1024. text-align: left;
  1025. color: #2a2a2a;
  1026. }
  1027. }
  1028. }
  1029. .fn-ul {
  1030. display: flex;
  1031. flex-wrap: wrap;
  1032. .fn-li {
  1033. width: 25%;
  1034. flex-grow: 1;
  1035. text-align: center;
  1036. font-size: 26upx;
  1037. margin-top: 16upx;
  1038. .fn-label {
  1039. color: #6a6a6a;
  1040. font-size: 26rpx;
  1041. }
  1042. .fn-icon {
  1043. image {
  1044. width: 70upx;
  1045. height: 70upx;
  1046. }
  1047. .ibonfont {
  1048. color: #000000;
  1049. font-size: 50upx;
  1050. padding-bottom: 10upx;
  1051. display: inline-block;
  1052. }
  1053. }
  1054. }
  1055. }
  1056. .order-ul {
  1057. .fn-li {
  1058. width: 20%;
  1059. position: relative;
  1060. .fn-icon {
  1061. image {
  1062. width: 64upx;
  1063. height: 64upx;
  1064. margin-bottom: 10rpx;
  1065. }
  1066. }
  1067. }
  1068. }
  1069. }
  1070. .list-model-view {
  1071. margin-bottom: 0;
  1072. border-bottom: 0;
  1073. padding-bottom: 0;
  1074. }
  1075. .call-pop {
  1076. .title {
  1077. text-align: center;
  1078. padding: 0 30rpx;
  1079. line-height: 90rpx;
  1080. height: 90rpx;
  1081. font-weight: bold;
  1082. position: relative;
  1083. .close-icon {
  1084. position: absolute;
  1085. font-weight: normal;
  1086. right: 30rpx;
  1087. top: 50%;
  1088. transform: translateY(-50%);
  1089. }
  1090. }
  1091. .call-ul {
  1092. padding: 0 30rpx 30rpx;
  1093. .call-li {
  1094. line-height: 80rpx;
  1095. height: 80rpx;
  1096. }
  1097. }
  1098. .call-btn {
  1099. width: 100%;
  1100. line-height: 80rpx;
  1101. height: 80rpx;
  1102. text-align: center;
  1103. }
  1104. }
  1105. </style>