user.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059
  1. <template>
  2. <view class="userPage" :style="[mainStyle]">
  3. <view class="mine" :style="'padding-top:'+systems.barHeight+'rpx;'">
  4. <image :src="picUrlss + 'wdbg1.png'" class="wdbg"></image>
  5. <view class="minec">
  6. <view class="avatar-box">
  7. <image :src="userInfos.avatar?userInfos.avatar:'../../static/pages/images/userimg.png'"
  8. mode="aspectFit" class="user" @click="jumpUrlInfo()"></image>
  9. <view class="avatar-up" v-if="!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1">
  10. 更新头像</view>
  11. </view>
  12. <view class="mines" @click="jumpUrlInfo()" v-if="isLogin">
  13. <view class="ddflex" style="justify-content: space-between;">
  14. <view class="ddflex">
  15. {{ userInfos.nickName ? userInfos.nickName : '-' }}
  16. <image :src="picUrlss+'info_bj.png'" class="info-bj"
  17. v-if="!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || userInfos.nickName.indexOf('用户') > -1"
  18. @click.stop="showUpdate()"></image>
  19. <image :src="config.ordinary_member_icon" class="common-vip"
  20. v-if="config.ordinary_member_icon && !userinfovip.levelGrade"></image>
  21. </view>
  22. </view>
  23. <text class="edu" v-if="userInfos.mobile">{{ userInfos.mobile ? userInfos.mobile: '手机号' }}</text>
  24. </view>
  25. <view class="flex" v-else><text class="login-btn" @click="jumpUrl('')">点击登录</text></view>
  26. <!-- #ifdef MP-WEIXIN -->
  27. <view class="card" @click.stop="jumpConversation()" style="position: relative;margin-right: 10rpx;">
  28. <image style="width: 48rpx;height: 48rpx;" src="../../static/images/chat.png"></image>
  29. <view v-if="unReadSpotNum>0" class="newsDot"></view>
  30. 消息
  31. </view>
  32. <!-- #endif -->
  33. <view class="card" @click="jumpCardUrl()"
  34. v-if="(distr.distributionIsOpen==1&&userInfos.isDistriUser == 2) || userInfos.isStaff">
  35. <image src="../../static/images/mp_ico.png" style="width: 45rpx;height: 48rpx;" mode="aspectFit">
  36. </image>
  37. 名片
  38. </view>
  39. <!-- <view class="rule dflex" @click="isSign == 0 || sign == 1 ? jumpUrl('') : signFun()" v-if="isShowSign">
  40. <image src="/static/pages/images/qdico.png"></image>
  41. {{ !isLogin ? '签到' : isSign == 0 || sign == 1 ? '已签到' : '签到' }}
  42. </view> -->
  43. </view>
  44. <view class="datas dflex">
  45. <navigator url="" hover-class="none" class="li" v-if="is_open_wallet.isOpenWallet == 1"
  46. @click="checkUpdate('wallet/index/index')">
  47. <text>{{ userMoney ? userMoney : '0.00' }}</text>
  48. 余额
  49. </navigator>
  50. <!-- <navigator
  51. url=""
  52. hover-class="none"
  53. class="li"
  54. :style="is_open_wallet.isOpenWallet != 1 && Open_Points_Mall != 1 ? 'width:50%' : ''"
  55. @click="jumpUrl('mine/coupons/coupons')"
  56. >
  57. <text>{{ userInfos.coupon ? userInfos.coupon : '0' }}</text>
  58. 优惠券
  59. </navigator> -->
  60. <!-- <navigator url="" hover-class="none" class="li" @click="jumpUrl('integralshop/index/index')">
  61. <text>{{ userInfos.integral ? userInfos.integral : '0' }}</text>
  62. 积分
  63. </navigator> -->
  64. <navigator url="" hover-class="none" class="li"
  65. :style="is_open_wallet.isOpenWallet != 1 && Open_Points_Mall != 1 ? 'width:50%' : ''"
  66. @click="jumpUrl('mine/collect/collect')">
  67. <text>{{ userInfos.collect ? userInfos.collect : '0' }}</text>
  68. 收藏
  69. </navigator>
  70. <navigator @click="jumpUrl('mine/footprint/footprint')" url="" hover-class="none" class="li">
  71. <text>{{ userInfos.footprint ? userInfos.footprint : '0' }}</text>
  72. 足迹
  73. </navigator>
  74. </view>
  75. <block v-if="isLogin">
  76. <view class="upgrade ddflex"
  77. v-if="config.ordinary_member_icon && userinfovip.levelGrade < vipList.length">
  78. <view :class="'li' + (!userinfovip.levelGrade ? ' active' : '')">
  79. <view>普通会员</view>
  80. </view>
  81. <view class="li" :class="{ active: userinfovip.level == item.id, cur: item.isShowInfo }"
  82. v-for="(item, index) in vipList" :key="index" @click="showInfo(index)">
  83. <view class="vip-info" v-if="item.isShowInfo && item.upgradeTerm.terms.length > 0">
  84. <text
  85. v-if="item.upgradeTerm.terms[0].bind == 'order_money'">累计消费金额达到{{ item.upgradeTerm.terms[0].value }}元即可升级</text>
  86. <text
  87. v-if="item.upgradeTerm.terms[0].bind == 'order_num'">累计购买订单达到{{ item.upgradeTerm.terms[0].value }}笔即可升级</text>
  88. <text
  89. v-if="item.upgradeTerm.terms[0].bind == 'share_new'">分享拉新人数累计达到{{ item.upgradeTerm.terms[0].value }}人即可升级</text>
  90. </view>
  91. <view class="vip-tit">{{ item.title }}</view>
  92. </view>
  93. </view>
  94. <!-- #ifdef MP-WEIXIN -->
  95. <button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" hover-class="none" class="vip"
  96. v-if="!userInfos.mobile">
  97. <image :src="picUrlss + 'blue/vip_bg.png'" class="vipbg"></image>
  98. <view class="vipc dflex">
  99. <view class="dflex flex">
  100. <image src="/static/pages/images/hg_ico1.png" class="vipimg"></image>
  101. <text class="huiyuan">会员立享专属权益</text>
  102. </view>
  103. <view class="ling">立即开通</view>
  104. </view>
  105. </button>
  106. <!-- #endif -->
  107. <!-- #ifndef MP-WEIXIN -->
  108. <view @click="goToVip()" hover-class="none" class="vip" v-if="!userInfos.mobile">
  109. <image :src="picUrlss + 'blue/vip_bg.png'" class="vipbg"></image>
  110. <view class="vipc dflex">
  111. <view class="dflex flex">
  112. <image src="/static/pages/images/hg_ico1.png" class="vipimg"></image>
  113. <text class="huiyuan">会员立享专属权益</text>
  114. </view>
  115. <view class="ling">立即开通</view>
  116. </view>
  117. </view>
  118. <!-- #endif -->
  119. <block v-else>
  120. <view class="vip" v-if="vipList && vipList.length >= 1 && rongkang != 'ZQ1VK5oc17I387E'"
  121. @click="checkUpdate('mine/vip/vip')">
  122. <image :src="picUrlss + 'blue/vip_bg.png'" class="vipbg"></image>
  123. <view class="vipc dflex">
  124. <view class="dflex flex" v-if="userinfovip.levelGrade > 0 && !userinfovip.end">
  125. <!-- <image :src="userinfovip.icon"></image> -->
  126. <image src="/static/pages/images/hg_ico1.png" class="vipimg"></image>
  127. <view class="huiyuan">{{ userinfovip.levelName }}</view>
  128. <!-- <text class="level" >{{userinfovip.levelGrade}}</text> -->
  129. </view>
  130. <view class="dflex flex" v-else>
  131. <image src="/static/pages/images/hg_ico1.png" class="vipimg"></image>
  132. <text class="huiyuan">会员立享专属权益</text>
  133. </view>
  134. <view class="cheng" v-if="userinfovip.levelGrade > 0 && !userinfovip.end">
  135. {{ userinfovip.expireTime }} 到期
  136. </view>
  137. <view class="ling" v-else>立即开通</view>
  138. </view>
  139. </view>
  140. </block>
  141. </block>
  142. <view class="vip" v-else @click="goToVip()">
  143. <image :src="picUrlss + 'blue/vip_bg.png'" class="vipbg"></image>
  144. <view class="vipc dflex">
  145. <view class="dflex flex">
  146. <image src="/static/pages/images/hg_ico1.png" class="vipimg"></image>
  147. <text class="huiyuan">会员立享专属权益</text>
  148. </view>
  149. <view class="ling">立即开通</view>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="con">
  154. <view class="order">
  155. <navigator url="" hover-class="none" class="tits dflex" @click="jumpUrl('mine/order/order')">
  156. <view class="flex">我的订单</view>
  157. 查看全部
  158. <image src="/static/pages/images/rico.png" class="rico"></image>
  159. </navigator>
  160. <view class="list1">
  161. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order')">
  162. <block v-if="showPageIcon">
  163. <image v-if="config.mainIconPath" :src="picUrlss +config.mainIconPath+ 'ddico0.png'"
  164. mode="aspectFit"></image>
  165. <image v-else :src="picUrlss + 'blue/ddico0.png'"></image>
  166. </block>
  167. <block v-else>
  168. <image src=""></image>
  169. </block>
  170. <view>全部订单</view>
  171. </navigator>
  172. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?state=1')">
  173. <block v-if="showPageIcon">
  174. <image v-if="config.mainIconPath" :src="picUrlss +config.mainIconPath+ 'ddico1.png'"
  175. mode="aspectFit"></image>
  176. <image v-else :src="picUrlss + 'blue/ddico1.png'"></image>
  177. </block>
  178. <block v-else>
  179. <image src=""></image>
  180. </block>
  181. <text class="new" v-if="quantityCensus.toBePaid > 0">{{ quantityCensus.toBePaid }}</text>
  182. <view>待付款</view>
  183. </navigator>
  184. <!-- <navigator url="" hover-class="none" class="li" @click="jumpUrl('service/secondCard/secondCard')"> -->
  185. <!-- <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?typeState=4')">
  186. <image :src="picUrlss + 'blue/ddico_dsy.png'"></image>
  187. <text class="new" v-if="quantityCensus.toBeWrittenOff > 0">{{ quantityCensus.toBeWrittenOff }}</text>
  188. <view>待核销</view>
  189. </navigator> -->
  190. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?state=3')">
  191. <block v-if="showPageIcon">
  192. <image v-if="config.mainIconPath" :src="picUrlss +config.mainIconPath+ 'ddico2.png'"
  193. mode="aspectFit"></image>
  194. <image v-else :src="picUrlss + 'blue/ddico2.png'"></image>
  195. </block>
  196. <block v-else>
  197. <image src=""></image>
  198. </block>
  199. <text class="new" v-if="quantityCensus.toBeShipped > 0">{{ quantityCensus.toBeShipped }}</text>
  200. <view>待发货</view>
  201. </navigator>
  202. <!-- <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?typeState=3')">
  203. <image :src="picUrlss + 'blue/ddico0.png'"></image>
  204. <text class="new" v-if="quantityCensus.toBeWithdrawn > 0">{{ quantityCensus.toBeWithdrawn }}</text>
  205. <view>待自提</view>
  206. </navigator> -->
  207. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?state=5')">
  208. <block v-if="showPageIcon">
  209. <image v-if="config.mainIconPath" :src="picUrlss +config.mainIconPath+ 'ddico3.png'"
  210. mode="aspectFit"></image>
  211. <image v-else :src="picUrlss + 'blue/ddico3.png'"></image>
  212. </block>
  213. <block v-else>
  214. <image src=""></image>
  215. </block>
  216. <text class="new"
  217. v-if="quantityCensus.toBeSignedIn > 0">{{ quantityCensus.toBeSignedIn }}</text>
  218. <view>待收货</view>
  219. </navigator>
  220. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?state=7')">
  221. <block v-if="showPageIcon">
  222. <image v-if="config.mainIconPath" :src="picUrlss +config.mainIconPath+ 'ddico0_1.png'"
  223. mode="aspectFit"></image>
  224. <image v-else :src="picUrlss + 'blue/ddico0_1.png'"></image>
  225. </block>
  226. <block v-else>
  227. <image src=""></image>
  228. </block>
  229. <text class="new" v-if="quantityCensus.completed > 0">{{ quantityCensus.completed }}</text>
  230. <view>已完成</view>
  231. </navigator>
  232. <!-- <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/order/order?typeState=7')">
  233. <image :src="picUrlss + 'blue/ddico0_1.png'"></image>
  234. <text class="new" v-if="quantityCensus.afterSales > 0">{{ quantityCensus.afterSales }}</text>
  235. <view>退款/售后</view>
  236. </navigator> -->
  237. </view>
  238. </view>
  239. </view>
  240. <!-- <view class="guwen" v-if="isShowAssistant">
  241. <view class="gw-tit">有问题?专属顾问来帮你~</view>
  242. <view class="gw-info ddflex">
  243. <image :src="assistant.avatar ? assistant.avatar : '../../static/pages/images/userimg.png'" mode="aspectFill"></image>
  244. <view class="fflex">
  245. <view class="gw-name">{{ assistant.nickName }}</view>
  246. <text class="gw-zc">{{ assistant.mobile }}</text>
  247. </view>
  248. <view class="gw-btn" @click="callAssistant()">联系他</view>
  249. </view>
  250. <view class="gw-tag ddflex">
  251. <image :src="picUrlss + 'scrm/gw_bg.png'" class="gw-bg"></image>
  252. <view>金牌顾问在线解答</view>
  253. </view>
  254. </view>
  255. <view class="hongbao ddflex" @click="jumpUrl('topic/redEnvelope/index')">
  256. <image :src="picUrlss + 'scrm/hb_img.png'" class="hb-img"></image>
  257. <view class="hb-info fflex">你有1条录入线索成为有效商机</view>
  258. <image :src="picUrlss + 'scrm/hb_rico.png'" class="hb-rico"></image>
  259. </view> -->
  260. <!-- 店铺 -->
  261. <view style="display: none;" class="order shopname" v-if="
  262. (userInfos.listMerchant && userInfos.listMerchant != null && userInfos.listMerchant.length > 0) ||
  263. (is_open_shop == 1 && userInfos.listShopBase && userInfos.listShopBase != null && userInfos.listShopBase.length > 0) ||
  264. userInfos.merchantId != null
  265. ">
  266. <image src="/static/pages/images/md_ic_bg.png" class="md_ic_bg"></image>
  267. <navigator url="" hover-class="none" class="tits dflex" @click="jumpMerchantManage()">
  268. <view class="ddflex fflex">
  269. <image src="/static/pages/images/position_b_icon.png" class="bico"></image>
  270. <view class="fflex tover" v-if="!userInfos.listShopBase || !userInfos.listMerchant">门店管理</view>
  271. <block v-else>
  272. <view class="fflex tover"
  273. v-if="userInfos.listMerchant.length > 0 && userInfos.listShopBase.length < 1">
  274. {{ userInfos.listMerchant[0].title ? userInfos.listMerchant[0].title : '门店管理' }}
  275. </view>
  276. <view class="fflex tover" v-else-if="userInfos.listShopBase.length > 0">
  277. {{ userInfos.listShopBase[0].title ? userInfos.listShopBase[0].title : '门店管理' }}
  278. </view>
  279. <!-- {{!listShopBase?listMerchant[0].title:listShopBase.length==0?listMerchant[0].title:listShopBase[0].title}} -->
  280. </block>
  281. </view>
  282. 查看更多
  283. <image src="/static/pages/images/rico.png" class="rico"></image>
  284. </navigator>
  285. <view class="datasw dflex">
  286. <navigator url="" hover-class="none" class="li" @click="jumpMerchantManage()">
  287. 全部订单
  288. <text>{{ statistics.total }}</text>
  289. </navigator>
  290. <navigator url="" hover-class="none" class="li" @click="jumpMerchantManage()">
  291. 待发货
  292. <text>{{ statistics.t3 }}</text>
  293. </navigator>
  294. <navigator url="" hover-class="none" class="li" @click="jumpMerchantManage()">
  295. 待核销
  296. <text>{{ statistics.toBeWrittenOff }}</text>
  297. </navigator>
  298. <navigator url="" hover-class="none" class="li" @click="jumpMerchantManage()">
  299. 待提货
  300. <text>{{ statistics.t4 }}</text>
  301. </navigator>
  302. </view>
  303. </view>
  304. <view class="order" v-if="distr.distributionIsOpen==1&&userInfos.isDistriUser == 2">
  305. <navigator url="/promote/index/index" hover-class="none" class="tits dflex">
  306. <view class="flex">推广合伙人</view>
  307. <image src="/static/pages/images/rico.png" class="rico"></image>
  308. </navigator>
  309. <view class="tuiguang">
  310. <view class="tuan-money ddflex">
  311. <view class="blance fflex" @click="jumpUrl('promote/index/index')">
  312. <view>{{commission.estimate ? commission.estimate : 0}}</view>累计收益
  313. </view>
  314. <view class="txbtn" @click="jumpUrl('promote/withdrawal/index/index')">我要提现</view>
  315. </view>
  316. <view class="tuan-all ddflex">
  317. <view class="li" @click="jumpUrl('promote/index/index')">
  318. <text>待结算</text>{{commission.settled ? commission.settled : 0}}
  319. </view>
  320. <view class="li" @click="jumpUrl('promote/index/index')">
  321. <text>可提现</text>{{commission.withdrawal ? commission.withdrawal : 0}}
  322. </view>
  323. </view>
  324. <view class="dingyue ddflex" v-if="isShowDing && !isSubscribe">
  325. <view class="fflex">订阅收益提醒消息</view>
  326. <view class="guan" @click="showAttention">订阅</view>
  327. <image src="../../static/pages/images/close1.png" class="ding-close" @click="closeDing"></image>
  328. </view>
  329. <view class="ceng" v-if="isShowAttention" @click="hideAttention()"></view>
  330. <view class="pop-att" v-if="isShowAttention">
  331. <image src="../../static/pages/images/close.png" class="att-close" @click="hideAttention()"></image>
  332. <view class="att-tit">订阅收益提醒消息</view>
  333. <view class="att-tip">即可接受团购提醒、新订单等通知</view>
  334. <view class="att-btn" @click="attentionWe()">立即订阅</view>
  335. </view>
  336. </view>
  337. <view class="list3">
  338. <view class="service-item border-top-solid" @click="jumpUrl('promote/invite/invite')">
  339. <view class="fflex">生成推广海报</view>
  340. <image :src="picUrlss+'blue/tg_ma.png'" class="service-icon"></image>
  341. <image src="/static/pages/images/rico.png" class="service-more"></image>
  342. </view>
  343. </view>
  344. </view>
  345. <block v-if="isLogin">
  346. <block v-if="distr.distributionIsOpen==1&&config.is_hide_distribution_entry != 1">
  347. <navigator url="" hover-class="none" class="order tuig" v-if="userInfos.isDistriUser==1"
  348. @click="jumpUrl('promote/status/status')">
  349. <view class="tits dflex">
  350. <view class="flex">全民推广</view>
  351. </view>
  352. <image :src="picUrlss+'fenxiao.png'" class="fenxiao"></image>
  353. </navigator>
  354. <navigator url="" hover-class="none" class="order tuig"
  355. v-if="userInfos.isDistriUser!=2 && userInfos.isDistriUser!=1" @click="jumpUrl('promote/info/info')">
  356. <view class="tits dflex">
  357. <view class="flex">全民推广</view>
  358. </view>
  359. <image :src="picUrlss+'fenxiao.png'" class="fenxiao"></image>
  360. </navigator>
  361. </block>
  362. </block>
  363. <navigator url="" hover-class="none" class="order tuig" @click="jumpUrl('promote/apply/apply')"
  364. v-if="!isLogin&&config.is_hide_distribution_entry != 1">
  365. <view class="tits dflex">
  366. <view class="flex">全民推广</view>
  367. </view>
  368. <image :src="picUrlss+'fenxiao.png'" class="fenxiao"></image>
  369. </navigator>
  370. <view class="box mlist">
  371. <!-- <view class="li ddflex" @click="jumpUrl('mine/activity/activity')">
  372. <image :src="picUrlss + 'scrm/mico_hd.png'" class="mico"></image>
  373. <view class="fflex">我的报名</view>
  374. <image src="../../static/pages/images/more.png" class="rico"></image>
  375. </view> -->
  376. <!-- <navigator class="li ddflex" url="/promote/invite/invite" hover-class="none">
  377. <image :src="picUrlss + 'scrm/mico_fx.png'" class="mico"></image>
  378. <view class="fflex">推荐给朋友</view>
  379. <image src="../../static/pages/images/more.png" class="rico"></image>
  380. </navigator> -->
  381. <view class="li ddflex">
  382. <view class="fflex">
  383. <contact-button class-name="ddflex" :img-url="picUrlss+'scrm/mico_kf.png'"
  384. img-style='width: 49rpx;height: 49rpx;margin: 0 25rpx 0 0;' button-text="联系客服"
  385. styles="line-height:initial;"></contact-button>
  386. </view>
  387. <image src="../../static/pages/images/more.png" class="rico"></image>
  388. </view>
  389. <navigator class="li ddflex" url="/pages/about/about" hover-class="none">
  390. <image :src="picUrlss + 'scrm/mico_about.png'" class="mico"></image>
  391. <view class="fflex">关于我们</view>
  392. <image src="../../static/pages/images/more.png" class="rico"></image>
  393. </navigator>
  394. <navigator class="li ddflex" url="/mine/feedback/feedback" hover-class="none">
  395. <image :src="picUrlss + 'scrm/mico_fk.png'" class="mico"></image>
  396. <view class="fflex">建议与反馈</view>
  397. <image src="../../static/pages/images/more.png" class="rico"></image>
  398. </navigator>
  399. <view class="li ddflex" @click="jumpUrl('mine/set/index')">
  400. <image :src="picUrlss + 'scrm/mico_set.png'" class="mico"></image>
  401. <view class="fflex">设置</view>
  402. <image src="../../static/pages/images/more.png" class="rico"></image>
  403. </view>
  404. </view>
  405. <footer-copyright></footer-copyright>
  406. <foot channel="user" :isUpdate="isUpdate"></foot>
  407. <update-userinfo :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" :is-update="true"
  408. v-if="isShowUpdate" @closeUpdate="closeUpdate" @updateMobileInfo="updateMobileInfo"></update-userinfo>
  409. </view>
  410. </template>
  411. <script>
  412. // pages/user/user.js
  413. const app = getApp();
  414. const req = require('../../utils/request.js');
  415. const api = require('../../utils/api.js');
  416. const route = require('../../utils/route');
  417. import foot from '../../components/nav-bar/index';
  418. import footerCopyright from '../../components/footer-copyright/footer-copyright';
  419. // let disp = require("../../hxChatSDK/utils/broadcast");
  420. export default {
  421. data() {
  422. return {
  423. mainStyle: app.globalData.mainStyle,
  424. skinNotColor: req.public.skinNotColor,
  425. picUrlss: req.public.picUrls,
  426. bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
  427. // merchantId: '',
  428. iconSrc: req.public.iconSrc,
  429. //头部页面背景链接
  430. isUpdate: false,
  431. //是否隐藏注册会员弹窗
  432. IS_secondary_members: 0,
  433. distr: '',
  434. userinfovip: '',
  435. userMoney: '',
  436. istetphone: '',
  437. logo: '',
  438. name: '',
  439. is_open_wallet: '',
  440. Open_Points_Mall: '',
  441. statistics: '',
  442. vipList: '',
  443. rongkang: req.header.appId,
  444. isSign: '',
  445. sign: 0,
  446. isLogin: false,
  447. noLogin: false,
  448. is_open_shop: '',
  449. isShowSign: false, //是否显示签到按钮
  450. config: {},
  451. userInfos: {},
  452. isShowAssistant: false, //是否显示顾问
  453. assistant: '',
  454. quantityCensus: '',
  455. commission: {},
  456. sessionKey: '',
  457. systems: '',
  458. showPageIcon: false,
  459. unReadSpotNum: 0,
  460. isShowUpdate: false, //是否显示更新信息弹窗
  461. isUpdateInfo: false, //更新用户信息
  462. isUpdateMobile: false, //绑定手机号
  463. cardInfo: '', //名片信息
  464. };
  465. },
  466. components: {
  467. foot,
  468. footerCopyright
  469. },
  470. props: {},
  471. async onLoad(options) {
  472. // 如果是tab页面不往下执行跳转tab缓存页面
  473. await this.getConfig().then(async res => {
  474. if (req.isTabPage('user', this.config.solution_name)) {
  475. req.toTabBar('user', options)
  476. return false
  477. } else {
  478. this.onLoadPage(options)
  479. }
  480. });
  481. },
  482. onShow: async function() {
  483. // 如果是tab页面不往下执行跳转tab缓存页面
  484. await this.getConfig().then(async res => {
  485. if (req.isTabPage('user', this.config.solution_name)) {
  486. return false
  487. } else {
  488. this.onShowPage()
  489. }
  490. });
  491. },
  492. methods: {
  493. onLoadPage(options) {
  494. //发起获取未读消息通知
  495. // disp.fire("em.main.ready");
  496. // //监听未读消息数
  497. // disp.on("em.unreadspot", this.onChatPageUnreadspot);
  498. app.globalData.getCheckSessoin(json => {
  499. this.sessionKey = json.session_key;
  500. });
  501. uni.setNavigationBarColor({
  502. frontColor: this.skinNotColor ? '#000' : '#ffffff',
  503. backgroundColor: this.skinNotColor ? '#fff' : req.public.titleTopBgColor
  504. });
  505. if (JSON.parse(req.getStorage('configRes')).IS_secondary_members) {
  506. let IS_secondary_members = JSON.parse(req.getStorage('configRes')).IS_secondary_members;
  507. console.log(IS_secondary_members);
  508. this.setData({
  509. IS_secondary_members: IS_secondary_members
  510. });
  511. }
  512. app.globalData.getCheckSessoin(json => {
  513. this.sessionKey = json.session_key;
  514. });
  515. },
  516. async onShowPage() {
  517. await this.getAbout();
  518. this.setData({
  519. isUpdate: !this.isUpdate
  520. });
  521. let userInfo = req.getStorage('userInfo');
  522. if (userInfo) {
  523. this.isLogin = true;
  524. }
  525. console.log('userInfo》》》》》',userInfo);
  526. // this.isLogin = true;
  527. if (this.isLogin) {
  528. await this.getMy();
  529. this.getRule();
  530. this.onChatPageUnreadspot()
  531. this.noLogin = true;
  532. } else {
  533. this.noLogin = false;
  534. }
  535. },
  536. // 消息
  537. onChatPageUnreadspot(message) {
  538. this.unReadSpotNum = getApp().globalData.unReadMessageNum > 99 ?
  539. "99+" : getApp().globalData.unReadMessageNum;
  540. // setTimeout(()=>{
  541. // console.log('-------------------------------->onChatPageUnreadspot<---------------------------')
  542. // this.unReadSpotNum = 2
  543. // this.isShowNews = true
  544. // },1000)
  545. },
  546. jumpSingleChatRoom() {
  547. // #ifdef MP-WEIXIN
  548. if (!this.getUpdate()) return false;
  549. // #endif
  550. if (this.advisor) {
  551. req.jumpSingleChatRoom(this.advisor.id, this.advisor.headUrl, this.advisor
  552. .realName);
  553. }
  554. },
  555. jumpConversation() {
  556. // #ifdef MP-WEIXIN
  557. if (!this.getUpdate()) return false;
  558. // #endif
  559. req.jumpConversation();
  560. },
  561. jumpUrlInfo() {
  562. if (req.isLogins(true)) {
  563. // #ifdef MP-WEIXIN
  564. if (!this.userInfos.avatar || this.userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || this.userInfos
  565. .nickName.indexOf('用户') > -1) {
  566. this.isShowUpdate = true;
  567. this.isUpdateInfo = true;
  568. } else {
  569. app.globalData.navigateTo('mine/userinfo/userinfo');
  570. }
  571. // #endif
  572. // #ifndef MP-WEIXIN
  573. app.globalData.navigateTo('mine/userinfo/userinfo');
  574. // #endif
  575. }
  576. },
  577. jumpUrl(url) {
  578. if (!req.isLogins(true)) {
  579. return false;
  580. }
  581. app.globalData.navigateTo(url);
  582. },
  583. jumpMerchantManage() {
  584. // jumpUrl('pages/web/web')
  585. let token = req.getStorage('AUTH_TOKEN');
  586. this.jumpUrl('merchant/index?appId=' + req.header.appId + '&token=' + token);
  587. },
  588. // 是否签到{}
  589. isSignFun() {
  590. req.getRequest('/api/integral/isSign', {}, res => {
  591. this.setData({
  592. isSign: res
  593. });
  594. });
  595. },
  596. gouserInfo() {
  597. app.globalData.navigateTo('mine/userinfo/userinfo');
  598. },
  599. getQuantityCensus() {
  600. req.getRequest('/api/order/quantityCensus', {}, res => {
  601. this.quantityCensus = res;
  602. });
  603. },
  604. getDistributionConfig() {
  605. req.postRequest('/api/distribution/config', {}, res => {
  606. this.setData({
  607. distr: res
  608. });
  609. if (res.distributionIsOpen == 1) {
  610. this.getAssistant();
  611. }
  612. });
  613. },
  614. getAssistant() {
  615. req.getRequest('/api/v3/assistant/exclusiveConsultant', {}, data => {
  616. this.assistant = data;
  617. if (data) {
  618. this.isShowAssistant = true;
  619. }
  620. });
  621. },
  622. // 签到
  623. signFun() {
  624. req.postRequest('/api/integral/sign', {}, data => {
  625. if (data) {
  626. req.msg('连续签到' + data.continuityDay + '天' + ',获得' + data.IntegralChange + '积分');
  627. this.setData({
  628. sign: 1
  629. });
  630. this.getOpenPonints();
  631. }
  632. });
  633. },
  634. getuserVip() {
  635. req.getRequest('/api/user/levelDetails', {}, data => {
  636. let expireTime = Array;
  637. if (data.expireTime) {
  638. expireTime = data.expireTime.split(' ');
  639. data.expireTime = data.expireTime.replace(/-/g, '/');
  640. } // 解决苹果不兼容---日期
  641. // data.expireTime=data.expireTime.replace(/-/g, '/')
  642. let nowTime = new Date().getTime();
  643. let endTime = new Date(data.expireTime).getTime();
  644. let times = parseInt((endTime - nowTime) / 1000); // var expireTime= new Date(data.expireTime)
  645. // var time1=expireTime.getTime();
  646. // console.log(times, nowTime, endTime, data.expireTime);
  647. this.setData({
  648. userinfovip: data,
  649. ['userinfovip.expireTime']: expireTime[0]
  650. });
  651. if (times <= 0) {
  652. this.setData({
  653. ['userinfovip.end']: true
  654. });
  655. } else {
  656. this.setData({
  657. ['userinfovip.end']: false
  658. });
  659. }
  660. // console.log(data);
  661. });
  662. },
  663. getOpenPonints() {
  664. req.getRequest('/api/integral/returnIntegral', {}, res => {
  665. this.setData({
  666. integral: res
  667. });
  668. });
  669. },
  670. getMy() {
  671. let that = this;
  672. if (req.getStorage('userInfo')) this.userInfos = req.getStorage('userInfo');
  673. return new Promise((resolve, reject) => {
  674. req.getRequest('/api/user/my', {}, data => {
  675. // data.merchantId = req.getStorage('userInfo').merchantId
  676. data.nickName = req.excludeSpecial(data.nickName);
  677. if (data.avatar || data.mobile || data.nickName) {
  678. let userInfo = req.getStorage('userInfo');
  679. if (userInfo) {
  680. userInfo.avatar = data.avatar;
  681. userInfo.mobile = data.mobile;
  682. userInfo.nickName = data.nickName;
  683. } else {
  684. userInfo = data;
  685. }
  686. req.setStorage('userInfo', userInfo)
  687. }
  688. this.userInfos = data;
  689. // that.setData(data); // this.isbindmobile();
  690. console.log('userinfo==' + JSON.stringify(data));
  691. this.isSignFun();
  692. this.getstatistics(data);
  693. this.getQuantityCensus();
  694. this.getDistributionConfig();
  695. this.getuserVip();
  696. this.getuserMoney();
  697. this.getVip();
  698. this.getOpenPonints();
  699. this.getCommission();
  700. this.getCardInfo();
  701. // console.log(this);
  702. resolve();
  703. });
  704. })
  705. },
  706. getuserMoney() {
  707. let is_open_wallet = JSON.parse(req.getStorage('configRes')).is_open_wallet;
  708. if (is_open_wallet) {
  709. if (JSON.parse(is_open_wallet).isOpenWallet == 1) {
  710. route.extendNew({}, res => {
  711. // console.log(parseFloat(res.all).toFixed(2));
  712. if (res)
  713. this.setData({
  714. userMoney: parseFloat(res.all).toFixed(2)
  715. });
  716. });
  717. }
  718. }
  719. },
  720. getConfig() {
  721. var _this = this;
  722. return new Promise((resolve, reject) => {
  723. if (req.getStorage('configRes')) {
  724. _this.config = JSON.parse(req.getStorage('configRes'));
  725. resolve();
  726. } else {
  727. req.getRequest('/api/config', {}, data => {
  728. req.setStorage('configRes', JSON.stringify(data));
  729. this.config = data;
  730. resolve(data);
  731. });
  732. }
  733. });
  734. },
  735. getAbout() {
  736. var _this = this;
  737. if (req.getStorage('configRes')) {
  738. _this.config = JSON.parse(req.getStorage('configRes'));
  739. _this.showPageIcon = true
  740. _this.getOtherConfig(JSON.parse(req.getStorage('configRes')));
  741. } else {
  742. return new Promise((resolve, reject) => {
  743. req.getRequest('/api/config', {}, function(res) {
  744. _this.config = res;
  745. _this.showPageIcon = true
  746. _this.getOtherConfig(res);
  747. resolve();
  748. });
  749. })
  750. }
  751. // 是否开启积分商城
  752. req.getRequest(
  753. '/api/params/value', {
  754. type: 'Open_Points_Mall'
  755. },
  756. res => {
  757. this.setData({
  758. Open_Points_Mall: res
  759. });
  760. }
  761. );
  762. },
  763. getOtherConfig(res) {
  764. let _this = this;
  765. _this.phone = res.CONFIG_SERVICE_HOT_MOBILE;
  766. _this.setData({
  767. istetphone: res.user_bind_mobile,
  768. logo: res.CONFIG_PROJECT_LOGO,
  769. name: res.CONFIG_PROJECT_TITLE
  770. });
  771. // console.log(res);
  772. if (res && res.is_open_wallet) {
  773. _this.setData({
  774. is_open_wallet: JSON.parse(res.is_open_wallet)
  775. });
  776. }
  777. if (res.is_open_shop) {
  778. _this.is_open_shop = res.is_open_shop;
  779. }
  780. if (res.user_bind_mobile == '1') {
  781. // 获取用户手机号
  782. let userInfo = req.getStorage('userInfo');
  783. if (userInfo && (userInfo.mobile == null || userInfo.mobile == '')) {
  784. // console.log("获取用户手机号===============================");
  785. // app.globalData.openPage('pages/authorize/authorize?bindmobile=1');
  786. }
  787. }
  788. },
  789. callPhone() {
  790. if (!req.isLogin()) return false;
  791. uni.makePhoneCall({
  792. phoneNumber: this.phone
  793. });
  794. },
  795. goUrl() {
  796. app.globalData.openPage('mine/vip/vip');
  797. },
  798. // 门店统计
  799. getstatistics(data) {
  800. let from = {};
  801. if (data.listShopBase && data.listShopBase != null && data.listShopBase.length > 0) {
  802. from.shopId = data.listShopBase[0].id;
  803. }
  804. if (data.listMerchant && data.listMerchant != null && data.listMerchant.length > 0 && data.listShopBase
  805. .length < 1) {
  806. from.merchantId = data.listMerchant[0].id;
  807. }
  808. req.getRequest('/api/order/statistics', from, data => {
  809. this.setData({
  810. statistics: data
  811. });
  812. console.log(data);
  813. });
  814. },
  815. getRule() {
  816. let that = this;
  817. req.getRequest('/api/integral/config', {}, res => {
  818. if (res && res.length > 0) {
  819. res.map(it => {
  820. if (it.illustrate && it.illustrate.indexOf('签到') > -1) {
  821. if (it.state == 2) {
  822. that.isShowSign = true;
  823. }
  824. }
  825. });
  826. }
  827. });
  828. },
  829. getVipListOrg() {
  830. if (this.vipList && this.userinfovip) {
  831. if (!this.userinfovip.levelGrade) {
  832. this.vipList.map((it, index) => {
  833. this.vipList[0].isShowInfo = true;
  834. });
  835. } else {
  836. this.vipList.map((it, index) => {
  837. if (this.userinfovip.level == it.id) {
  838. if (index < this.vipList.length - 1) {
  839. this.vipList[index + 1].isShowInfo = true;
  840. }
  841. }
  842. });
  843. }
  844. }
  845. },
  846. getVip() {
  847. req.getRequest('/api/levelStrategy/userLevelList', {}, data => {
  848. if (data && data.length > 0) {
  849. data.map((it, index) => {
  850. it.upgradeTerm = JSON.parse(it.upgradeTerm);
  851. it.isShowInfo = false;
  852. // if(index == 0) it.isShowInfo = true;
  853. return it;
  854. });
  855. this.vipList = data;
  856. this.getVipListOrg();
  857. }
  858. });
  859. },
  860. getCommission() {
  861. req.getRequest('/api/v3/distribution/commission/data', {}, data => {
  862. this.commission = data;
  863. })
  864. },
  865. showInfo(index) {
  866. if (!this.vipList[index].isShowInfo) {
  867. this.vipList.map(it => {
  868. it.isShowInfo = false;
  869. return it;
  870. });
  871. }
  872. this.vipList[index].isShowInfo = !this.vipList[index].isShowInfo;
  873. },
  874. callAssistant() {
  875. uni.makePhoneCall({
  876. phoneNumber: this.assistant.mobile
  877. });
  878. },
  879. getPhoneNumber(event) {
  880. const _ts = this;
  881. const detail = event.detail;
  882. if (!detail || !detail.encryptedData || !detail.iv) return false;
  883. req.postRequest('/api/weixin/mobile', {
  884. encryptedData: detail.encryptedData,
  885. iv: detail.iv,
  886. sessionKey: _ts.sessionKey
  887. }, res => {
  888. _ts.getMy();
  889. let userInfo = req.getStorage('userInfo');
  890. userInfo.mobile = res.mobile;
  891. req.setStorage('userInfo', userInfo);
  892. _ts.jumpUrl('mine/vip/vip');
  893. });
  894. },
  895. goToVip() {
  896. if (req.isLogins(true)) {
  897. this.getMy();
  898. this.jumpUrl('mine/vip/vip');
  899. }
  900. },
  901. scanCode() {
  902. var _this = this; // 允许从相机和相册扫码
  903. uni.scanCode({
  904. success: res => {
  905. console.log('扫码结果1111==', res)
  906. let path = res.path.split('?scene=')[0];
  907. let scene = res.path.split('?scene=')[1];
  908. let paths = '/' + path + '?scene=' + encodeURIComponent(scene);
  909. console.log('paths===', paths)
  910. uni.switchTab({
  911. url: paths
  912. }); // this.scene = '1290926887903780865';
  913. }
  914. });
  915. },
  916. getUpdate() {
  917. let userInfos = this.userInfos;
  918. if (!userInfos.mobile) {
  919. console.log('没有手机号')
  920. this.isShowUpdate = true;
  921. this.isUpdateMobile = true;
  922. req.setStorage('isShowUpdateMobile', true)
  923. return false;
  924. }
  925. if (!userInfos.avatar || userInfos.avatar.indexOf('thirdwx.qlogo') > -1 || userInfos.nickName.indexOf(
  926. '用户') > -1) {
  927. console.log('没有昵称')
  928. this.isShowUpdate = true;
  929. this.isUpdateInfo = true;
  930. req.setStorage('isShowUpdateInfo', true)
  931. return false;
  932. }
  933. return true;
  934. },
  935. showUpdate() {
  936. // #ifdef H5
  937. this.jumpUrlInfo();
  938. // #endif
  939. // #ifdef MP-WEIXIN
  940. this.isShowUpdate = true;
  941. this.isUpdateInfo = true;
  942. // #endif
  943. },
  944. checkUpdate(url) {
  945. if (!req.isLogins(true)) {
  946. return false;
  947. }
  948. // #ifdef MP-WEIXIN
  949. if (this.getUpdate()) {
  950. this.jumpUrl(url);
  951. }
  952. // #endif
  953. // #ifndef MP-WEIXIN
  954. this.jumpUrl(url);
  955. // #endif
  956. },
  957. closeUpdate() {
  958. this.isShowUpdate = false
  959. this.isUpdateInfo = false;
  960. this.isUpdateMobile = false;
  961. },
  962. updateMobileInfo(e) {
  963. this.getMy();
  964. },
  965. getCardInfo() {
  966. return new Promise((resolve, reject) => {
  967. req.getRequest(api.card_userInfo, {}, data => {
  968. this.cardInfo = data;
  969. resolve(data)
  970. })
  971. })
  972. },
  973. async jumpCardUrl() {
  974. console.log('this.cardInfo==', this.cardInfo)
  975. let cardInfo = this.cardInfo;
  976. if (cardInfo) this.jumpUrl('card/index/index');
  977. else {
  978. cardInfo = await this.getCardInfo()
  979. if (cardInfo) this.jumpUrl('card/index/index');
  980. else this.jumpUrl('card/not/not');
  981. }
  982. },
  983. closeDing() {
  984. this.isShowDing = false;
  985. },
  986. showAttention() {
  987. this.isShowAttention = true;
  988. },
  989. hideAttention() {
  990. this.isShowAttention = false;
  991. },
  992. attentionWe() {
  993. this.isShowAttention = false;
  994. uni.navigateTo({
  995. url: '/pages/webview/web?webUrl=https://mp.weixin.qq.com/s/HDpeIZXQR-MTBrNI6v6E4A'
  996. })
  997. },
  998. },
  999. beforeMount() {
  1000. const systemInfo = uni.getSystemInfoSync();
  1001. console.log('systemInfo==', systemInfo)
  1002. // px转换到rpx的比例
  1003. let pxToRpxScale = 750 / systemInfo.windowWidth;
  1004. let systems = {
  1005. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  1006. navigationHeight: 44 * pxToRpxScale, // 导航栏的高度
  1007. };
  1008. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  1009. this.systems = systems;
  1010. },
  1011. };
  1012. </script>
  1013. <style scoped>
  1014. @import './user.css';
  1015. </style>