user.vue 31 KB

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