user.vue 32 KB

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