index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. <template>
  2. <view class="content">
  3. <view class="head">
  4. <view class="head_image">
  5. <!-- #ifdef MP-WEIXIN -->
  6. <button open-type="chooseAvatar" v-if="token" @chooseavatar="onChooseAvatar">
  7. <image style="width: 90rpx; height: 90rpx; border-radius: 50%" :src="avatar ? avatar : '../../static/logo.png'"></image>
  8. </button>
  9. <image v-if="!token" @click="bindlogin" style="width: 90rpx; height: 90rpx; border-radius: 50%" src="../../static/logo.png"></image>
  10. <!-- #endif -->
  11. <!-- #ifndef MP-WEIXIN -->
  12. <image @click="avatar ? goLogin() : ''" style="width: 90rpx; height: 90rpx; border-radius: 50%" :src="avatar ? avatar : '../../static/logo.png'"></image>
  13. <!-- #endif -->
  14. <view class="lovip" v-if="isVip">
  15. <image src="../../static/images/my/vip.png" style="width: 88rpx; height: 32rpx; top: -30rpx"></image>
  16. </view>
  17. </view>
  18. <view class="head_name">
  19. <!-- -->
  20. <view class="name" v-if="token" @click="goShop('/pages/my/updateNickName')">{{ userName }}</view>
  21. <view class="name" v-if="!token" @click="bindlogin">登录</view>
  22. </view>
  23. </view>
  24. <view class="margin-lr padding-lr-sm padding-tb radius flex justify-between" v-if="XCXIsSelect == '是'">
  25. <view class="text-center text-black" @click="goShop('/my/coupon/index')">
  26. <view class="text-lg text-bold">{{ msgData.countCoupon }}</view>
  27. <view>外卖优惠券</view>
  28. </view>
  29. <!-- @click="goShop('/my/wallet/index')" -->
  30. <view class="text-center text-black">
  31. <view class="text-lg text-bold">{{ msgData.userMoney }}</view>
  32. <view>我的余额</view>
  33. </view>
  34. <view class="text-center text-black" @click="goShop('/my/task/index')">
  35. <view class="text-lg text-bold">{{ msgData.userIntegral }}</view>
  36. <view>我的积分</view>
  37. </view>
  38. </view>
  39. <view class="margin-bottom padding-lr" style="position: relative" v-if="XCXIsSelect == '是'">
  40. <image src="../../static/images/my/bg.png" style="width: 100%; height: 110rpx" mode=""></image>
  41. <view class="flex justify-between margin-lr padding-tb-sm radius" style="position: absolute; top: 0; width: 640rpx">
  42. <image src="../../static/images/my/huiyuan.png" style="width: 70rpx; height: 70rpx"></image>
  43. <view class="flex-sub margin-left text-lg text-bold" style="line-height: 74rpx; color: #604320">超级会员享特权</view>
  44. <view v-if="!isVip" class="btn-bg" style="color: #604320" @click="goNav({ url: '/my/vip/index' })">去开通</view>
  45. <view v-if="isVip" class="btn-bg" style="color: #604320" @click="goNav({ url: '/my/vip/index' })">已开通</view>
  46. </view>
  47. </view>
  48. <view class="center flex justify-between bg-white margin-top padding-lr padding-tb-lg radius">
  49. <view class="flex justify-between flex-sub padding-right" style="border-right: 2rpx solid #cccccc" @click="goShop('/my/task/index')">
  50. <view class="">
  51. <view class="text-black text-xl text-bold">每日任务</view>
  52. <view class="text-sm margin-top-xs">每日签到领积分</view>
  53. </view>
  54. <image src="../../static/images/my/renwu.png" mode="" style="width: 88rpx; height: 88rpx"></image>
  55. </view>
  56. <view class="flex justify-between flex-sub padding-left" @click="goShop('/my/integral/index')">
  57. <view class="">
  58. <view class="text-black text-xl text-bold">积分商城</view>
  59. <view class="text-sm margin-top-xs flex align-center">积分兑换优惠券</view>
  60. </view>
  61. <image src="../../static/images/my/jifen.png" mode="" style="width: 88rpx; height: 88rpx"></image>
  62. </view>
  63. </view>
  64. <view class="margin padding-lr-sm padding-tb bg-white radius">
  65. <view class="flex justify-between align-center">
  66. <view class="text-lg text-bold text-black">推荐工具</view>
  67. </view>
  68. <view class="flex flex-wrap">
  69. <!-- #ifdef MP-WEIXIN -->
  70. <view class="text-center margin-tb-sm" style="width: 25%" v-if="XCXIsSelect == '是'">
  71. <button class="btn" open-type="share">
  72. <image src="../../static/images/my/4.png" style="width: 50rpx; height: 48rpx" mode=""></image>
  73. <view>分享好友</view>
  74. </button>
  75. </view>
  76. <view class="text-center margin-tb-sm" style="width: 25%" @click="goApplet(shopAppId)" v-if="shopStatus == 1 && XCXIsSelect == '是'">
  77. <image src="../../static/images/my/1.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  78. <view class="text-sm">商家入驻</view>
  79. </view>
  80. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/apply/index' })" v-if="shopStatus != 1 && XCXIsSelect == '是'">
  81. <image src="../../static/images/my/1.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  82. <view class="text-sm">商家入驻</view>
  83. </view>
  84. <!-- <view class="text-center margin-tb-sm" style="width: 25%;" @click="goApplet(qishouAppId)"
  85. v-if="XCXIsSelect=='是'">
  86. <image src="../../static/images/my/11.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
  87. </image>
  88. <view class="text-sm">骑手入驻</view>
  89. </view> -->
  90. <!-- #endif -->
  91. <!-- #ifndef MP-WEIXIN -->
  92. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/apply/index' })" v-if="shopStatus != 1">
  93. <image src="../../static/images/my/1.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  94. <view class="text-sm">商家入驻</view>
  95. </view>
  96. <!-- #ifdef APP -->
  97. <view class="text-center margin-tb-sm" style="width: 25%" @click="shopRuzhu" v-else>
  98. <image src="../../static/images/my/1.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  99. <view class="text-sm">商家入驻</view>
  100. </view>
  101. <!-- #endif -->
  102. <!-- #endif -->
  103. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/tousu/index' })" v-if="XCXIsSelect == '是'">
  104. <image src="../../static/images/order/tousu.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  105. <view class="text-sm">我的投诉</view>
  106. </view>
  107. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/myPingJia/myPingJia' })" v-if="XCXIsSelect == '是'">
  108. <image src="../../static/images/order/pingjia.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  109. <view class="text-sm">我的评价</view>
  110. </view>
  111. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/helpList/index' })">
  112. <image src="../../static/images/my/12.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  113. <view class="text-sm">帮助中心</view>
  114. </view>
  115. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/msg/index' })" v-if="XCXIsSelect == '是'">
  116. <image src="../../static/images/my/3.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  117. <view class="text-sm">消息中心</view>
  118. </view>
  119. <!-- <view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/running/index/index'})"
  120. v-if="XCXIsSelect=='是'">
  121. <image src="../../static/images/my/5.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
  122. </image>
  123. <view class="text-sm">同城跑腿</view>
  124. </view> -->
  125. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/setting/chat' })" v-if="XCXIsSelect == '是'">
  126. <image src="../../static/images/my/6.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  127. <view class="text-sm">联系客服</view>
  128. </view>
  129. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/address/index' })">
  130. <image src="../../static/images/my/7.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  131. <view class="text-sm">地址管理</view>
  132. </view>
  133. <!-- <view class="text-center margin-tb-sm" style="width: 25%;" @click="goNav({url:'/my/hongbao/hongbao'})"
  134. v-if="XCXIsSelect=='是'">
  135. <image src="../../static/images/my/9.png" style="width: 55rpx;height: 55rpx;" mode="scaleToFill">
  136. </image>
  137. <view class="text-sm">跑腿红包</view>
  138. </view> -->
  139. <view class="text-center margin-tb-sm" style="width: 25%; position: relative" @click="goNav({ url: '/my/chat/index' })" v-if="XCXIsSelect == '是'">
  140. <image src="../../static/images/order/kefu.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  141. <view class="text-sm">聊天室</view>
  142. <view
  143. v-if="messageCount > 0"
  144. style="
  145. height: 32rpx;
  146. width: 32rpx;
  147. border-radius: 100rpx;
  148. background-color: red;
  149. color: #fff;
  150. text-align: center;
  151. position: absolute;
  152. top: -10rpx;
  153. right: 24rpx;
  154. "
  155. >
  156. {{ messageCount }}
  157. </view>
  158. </view>
  159. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/setting/index' })">
  160. <image src="../../static/images/my/8.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  161. <view class="text-sm">系统设置</view>
  162. </view>
  163. <view class="text-center margin-tb-sm" style="width: 25%" @click="goNav({ url: '/my/taocan/list' })">
  164. <image src="https://mxys.chuanghai-tech.com/wmfile/20250812/6431457fbda24074af9bcd5c229eaa7e.png" style="width: 55rpx; height: 55rpx" mode="scaleToFill"></image>
  165. <view class="text-sm">我的套餐</view>
  166. </view>
  167. </view>
  168. </view>
  169. <!-- 联系客服悬浮按钮区域 -->
  170. <view class="serviceBtn" @click="goChat">
  171. <img src="../../static/images/my/13.png" style="width: 60rpx; height: 60rpx" mode="scaleToFill" />
  172. <view class="serviceBtn_text">联系客服</view>
  173. </view>
  174. <!-- 用于图片压缩的canvas画布 -->
  175. <canvas
  176. :style="{
  177. width: cw + 'px',
  178. height: cw + 'px',
  179. position: 'absolute',
  180. zIndex: -1,
  181. left: '-10000rpx',
  182. top: '-10000rpx'
  183. }"
  184. canvas-id="zipCanvas"
  185. ></canvas>
  186. <!--画布结束-->
  187. </view>
  188. </template>
  189. <script>
  190. import configdata from '@/common/config.js'
  191. import getLessLimitSizeImage from '@/utils/imageCompress.js'
  192. export default {
  193. data() {
  194. return {
  195. messageCount: 0,
  196. avatar: '',
  197. userName: '',
  198. checkCertification: -1,
  199. arr: [],
  200. showModal: true,
  201. msgData: {
  202. userIntegral: 0,
  203. countCoupon: 0,
  204. userMoney: 0
  205. },
  206. tuiguang: '',
  207. tuiguangImg: '',
  208. token: '',
  209. XCXIsSelect: '否',
  210. shopStatus: '',
  211. isVip: false,
  212. messageCount: 0,
  213. time: '',
  214. qishouAppId: '', //骑手APPID
  215. shopAppId: '', //商户appid
  216. //画板边长默认是屏幕宽度,正方形画布
  217. cw: uni.getSystemInfoSync().windowWidth
  218. }
  219. },
  220. onLoad() {
  221. let that = this
  222. that.token = that.$queue.getData('token')
  223. that.$Request.get('/app/common/type/248').then((res) => {
  224. //跑腿师傅端微信小程序APPID 248
  225. if (res.code == 0) {
  226. that.qishouAppId = res.data.value
  227. }
  228. })
  229. that.$Request.get('/app/common/type/305').then((res) => {
  230. //商户端微信小程序APPID 305
  231. if (res.code == 0) {
  232. that.shopAppId = res.data.value
  233. }
  234. })
  235. that.XCXIsSelect = that.$queue.getData('XCXIsSelect') ? that.$queue.getData('XCXIsSelect') : '是'
  236. that.time = setInterval(function () {
  237. that.messageCount = uni.getStorageSync('messageCount')
  238. if (that.messageCount) {
  239. that.messageCount = that.messageCount
  240. } else {
  241. that.messageCount = 0
  242. }
  243. }, 3000)
  244. that.getZiZhi()
  245. console.log('that.XCXIsSelect___:' + that.XCXIsSelect)
  246. },
  247. onHide() {
  248. clearInterval(this.time)
  249. },
  250. onShow() {
  251. let that = this
  252. // this.avatar = this.$queue.getData('avatar') || '';
  253. // this.userName = this.$queue.getData('userName') || '';
  254. that.token = that.$queue.getData('token')
  255. if (that.token) {
  256. that.getUserInfo()
  257. that.getMsgData()
  258. that.messageCount = uni.getStorageSync('messageCount')
  259. if (that.messageCount) {
  260. that.messageCount = that.messageCount
  261. } else {
  262. that.messageCount = 0
  263. }
  264. } else {
  265. that.token = ''
  266. that.isVip = false
  267. that.userName = ''
  268. that.avatar = ''
  269. that.msgData.userIntegral = 0
  270. that.msgData.countCoupon = 0
  271. that.msgData.userMoney = 0
  272. }
  273. },
  274. onShareAppMessage(res) {
  275. //发送给朋友
  276. return {
  277. title: this.tuiguang,
  278. path: '/pages/index/index',
  279. imageUrl: this.tuiguangImg
  280. }
  281. },
  282. onShareTimeline(res) {
  283. //分享到朋友圈
  284. return {
  285. title: this.tuiguang,
  286. path: '/pages/index/index',
  287. imageUrl: this.tuiguangImg
  288. }
  289. },
  290. methods: {
  291. goChat() {
  292. if (this.token) {
  293. uni.navigateTo({
  294. url: '/my/setting/chat'
  295. })
  296. } else {
  297. this.bindlogin()
  298. }
  299. },
  300. //微信填写能力获取头像
  301. onChooseAvatar(e) {
  302. console.log(e.detail.avatarUrl)
  303. let that = this
  304. let token = uni.getStorageSync('token')
  305. uni.showLoading({
  306. title: '上传中...',
  307. mask: true // 是否显示透明蒙层,防止触摸穿透
  308. })
  309. uni.uploadFile({
  310. // url: config.APIHOST1 + '/alioss/upload', //仅为示例,非真实的接口地址
  311. url: that.config('APIHOST1') + '/alioss/upload', //仅为示例,非真实的接口地址
  312. filePath: e.detail.avatarUrl,
  313. header: {
  314. token: token
  315. },
  316. name: 'file',
  317. success: (uploadFileRes) => {
  318. let url = JSON.parse(uploadFileRes.data).data
  319. that.$Request.postJson('/app/user/updateUserImageUrl?avatar=' + url).then((res) => {
  320. uni.hideLoading()
  321. if (res.code === 0) {
  322. that.$queue.showToast('更新成功')
  323. that.getUserInfo()
  324. }
  325. })
  326. }
  327. })
  328. },
  329. // getName(){
  330. // wx.requestPayment({
  331. // timeStamp: '1723710543',
  332. // nonceStr: '7db6a8aec2a542c7a4852c856595fcd3',
  333. // package: 'prepay_id=wx15162903191561245ec1269166539c0000',
  334. // signType: 'RSA',
  335. // paySign: 'AyvptQMyOiP5cmbInu3fsg4ww3HYm+YYOCwkRyFM2DgFpe3DO4jAhyHpaFsZywnaK0rZVIFI1lgF3tV5fFxTSj1PMSzZpFEVPOHg5uCw6O21ESIJ9XuockX9iWyWcNv5gY5W8ARm73Kt/bZRjyXtE68Ryr1D5Fievo3gh7u71vt2FczvO4Nb0C2u7BY3UOWQ9BEHskuYPhpBkpeuoogorNRtBbg4DHiege1hhcf5On3of/xsGnBPMHNUgix8ljSX+A769XGedzxzQQ5z63Pi7svletdlUewyHdhyTLhXhVqHQLWG/ImdCw3PaXjsoefbdXxv8e3epx3Kux77nTta3w==',
  336. // success (res) {
  337. // console.log(res,'成功')
  338. // },
  339. // fail (res) {
  340. // console.log(res,'失败')
  341. // }
  342. // })
  343. // },
  344. goLogin() {
  345. let that = this
  346. var url = null
  347. let userId = this.$queue.getData('userId')
  348. if (!userId) {
  349. this.bindlogin()
  350. return
  351. }
  352. uni.showActionSheet({
  353. // itemList按钮的文字接受的是数组
  354. itemList: ['查看头像', '从相册选择图片'],
  355. success(e) {
  356. var index = e.tapIndex
  357. if (index === 0) {
  358. // 用户点击了预览当前图片
  359. // 可以自己实现当前头像链接的读取
  360. let url = that.avatar
  361. let arr = []
  362. arr.push(url)
  363. uni.previewImage({
  364. // 预览功能图片也必须是数组的
  365. urls: arr
  366. })
  367. } else if (index === 1) {
  368. uni.chooseImage({
  369. count: 1,
  370. sourceType: ['album'],
  371. success: (res) => {
  372. let token = uni.getStorageSync('token')
  373. for (let i = 0; i < res.tempFiles.length; i++) {
  374. //这里的id和页面中写的html代码的canvas的id要一致
  375. let canvasId = 'zipCanvas'
  376. //原图的路径
  377. let imagePath = res.tempFiles[i].path
  378. //大小限制
  379. let limitSize = 1024 * 2
  380. //初始绘画区域是画布自身的宽度也就是屏幕宽度
  381. let drawWidth = uni.getSystemInfoSync().windowWidth
  382. let that = this
  383. getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, that, (resPath) => {
  384. uni.showLoading({
  385. title: '上传中'
  386. })
  387. uni.uploadFile({
  388. url: that.config('APIHOST') + '/alioss/upload',
  389. filePath: resPath,
  390. header: {
  391. token: token
  392. },
  393. name: 'file',
  394. success: (uploadFileRes) => {
  395. url = JSON.parse(uploadFileRes.data).data
  396. that.$Request.postJson('/app/user/updateUserImageUrl?avatar=' + url).then((res) => {
  397. uni.hideLoading()
  398. if (res.code === 0) {
  399. that.$queue.showToast('更新成功')
  400. that.getUserInfo()
  401. }
  402. })
  403. },
  404. fail: () => {
  405. uni.showToast({
  406. title: '上传失败',
  407. icon: 'error'
  408. })
  409. }
  410. })
  411. })
  412. }
  413. }
  414. })
  415. }
  416. }
  417. })
  418. },
  419. shopRuzhu() {
  420. uni.showToast({
  421. title: '请先下载同城外卖商户端APP',
  422. icon: 'none'
  423. })
  424. },
  425. getMsgData() {
  426. this.$Request.get('/app/userintegral/findUserMessage').then((res) => {
  427. if (res.code == 0) {
  428. this.msgData = res.data
  429. }
  430. })
  431. },
  432. // 分享文案和图片
  433. getZiZhi() {
  434. this.$Request.getT('/app/common/type/239').then((res) => {
  435. if (res.code === 0) {
  436. this.tuiguang = res.data.value
  437. }
  438. })
  439. this.$Request.getT('/app/common/type/238').then((res) => {
  440. if (res.code === 0) {
  441. this.tuiguangImg = res.data.value
  442. }
  443. })
  444. },
  445. goSwt(e) {
  446. uni.setStorageSync('current', e)
  447. setTimeout(function () {
  448. uni.switchTab({
  449. url: '/pages/order/index'
  450. })
  451. }, 10)
  452. },
  453. goApplet(e) {
  454. uni.navigateToMiniProgram({
  455. appId: e,
  456. path: 'pages/index/index',
  457. success(res) {
  458. // 打开成功
  459. }
  460. })
  461. },
  462. goNav(e) {
  463. if (this.token) {
  464. if (e.name == '注册骑手') {
  465. uni.navigateToMiniProgram({
  466. appId: 'wxa59b58efa950ba1f',
  467. path: '/pages/login/login',
  468. extraData: {
  469. data1: 'test'
  470. },
  471. success(res) {
  472. // 打开成功
  473. console.log('打开成功')
  474. }
  475. })
  476. } else if (e.name == '分享好友') {
  477. uni.share({
  478. provider: 'weixin',
  479. scene: 'WXSceneSession',
  480. type: 1,
  481. summary: '我正在使用HBuilderX开发uni-app,赶紧跟我一起来体验!',
  482. success: function (res) {
  483. console.log('success:' + JSON.stringify(res))
  484. },
  485. fail: function (err) {
  486. console.log('fail:' + JSON.stringify(err))
  487. }
  488. })
  489. } else {
  490. uni.navigateTo({
  491. url: e.url
  492. })
  493. }
  494. } else if (e.url == '/my/helpList/index') {
  495. uni.navigateTo({
  496. url: e.url
  497. })
  498. } else {
  499. this.bindlogin()
  500. }
  501. },
  502. goShop(url) {
  503. if (this.token) {
  504. uni.navigateTo({
  505. url
  506. })
  507. } else {
  508. this.bindlogin()
  509. }
  510. },
  511. getUserInfo() {
  512. this.$Request.getT('/app/user/selectUserMessage').then((res) => {
  513. console.log(res)
  514. if (res.code == 0) {
  515. if (parseInt(res.data.checkCertification)) {
  516. this.checkCertification = parseInt(res.data.checkCertification)
  517. } else {
  518. this.checkCertification = -1
  519. }
  520. this.isVip = res.data.isVip
  521. this.shopStatus = res.data.shopStatus
  522. this.$queue.setData('avatar', res.data.avatar ? res.data.avatar : '../../static/logo.png')
  523. this.$queue.setData('userId', res.data.userId)
  524. this.$queue.setData('phone', res.data.phone)
  525. this.$queue.setData('status', res.data.status)
  526. this.$queue.setData('userName', res.data.userName ? res.data.userName : res.data.nickName)
  527. this.avatar = res.data.avatar ? res.data.avatar : '../../static/logo.png'
  528. this.userName = res.data.userName ? res.data.userName : res.data.nickName
  529. }
  530. })
  531. },
  532. bindlogin() {
  533. if (!this.token) {
  534. uni.navigateTo({
  535. url: '/pages/public/login'
  536. })
  537. }
  538. },
  539. bindTo(name) {
  540. console.log(name)
  541. if (this.token) {
  542. if (name == '我的红包') {
  543. uni.navigateTo({
  544. url: '/pages/my/hongbao/hongbao'
  545. })
  546. } else if (name == '注册骑手') {
  547. uni.navigateToMiniProgram({
  548. appId: 'wx5ed22ce813e47796',
  549. path: '/pages/index/index',
  550. extraData: {
  551. data1: 'test'
  552. },
  553. success(res) {
  554. // 打开成功
  555. console.log('打开成功')
  556. }
  557. })
  558. } else if (name == '意见反馈') {
  559. uni.navigateTo({
  560. url: '/pageA/feedback/feedback'
  561. })
  562. } else if (name == '联系客服') {
  563. uni.navigateTo({
  564. url: '/pageA/kefu/kefu'
  565. })
  566. } else if (name == '系统设置') {
  567. uni.navigateTo({
  568. url: '/pages/my/set/set'
  569. })
  570. } else if (name == '地址管理') {
  571. uni.navigateTo({
  572. url: '/pageA/address/address'
  573. })
  574. }
  575. } else {
  576. this.bindlogin()
  577. }
  578. },
  579. bindapprove() {
  580. if (this.token) {
  581. uni.navigateTo({
  582. url: '/pages/my/approve/approve'
  583. })
  584. } else {
  585. this.bindlogin()
  586. }
  587. },
  588. binduser() {
  589. if (this.token) {
  590. // uni.navigateTo({
  591. // url: '/pages/my/userphone/userphone'
  592. // })
  593. } else {
  594. this.bindlogin()
  595. }
  596. },
  597. config: function (name) {
  598. var info = null
  599. if (name) {
  600. var name2 = name.split('.') //字符分割
  601. if (name2.length > 1) {
  602. info = configdata[name2[0]][name2[1]] || null
  603. } else {
  604. info = configdata[name] || null
  605. }
  606. if (info == null) {
  607. let web_config = cache.get('web_config')
  608. if (web_config) {
  609. if (name2.length > 1) {
  610. info = web_config[name2[0]][name2[1]] || null
  611. } else {
  612. info = web_config[name] || null
  613. }
  614. }
  615. }
  616. }
  617. return info
  618. }
  619. }
  620. }
  621. </script>
  622. <style>
  623. button::after {
  624. border: none;
  625. background-color: none;
  626. }
  627. button {
  628. position: relative;
  629. display: block;
  630. margin-left: auto;
  631. margin-right: auto;
  632. padding-left: 0px;
  633. padding-right: 0px;
  634. box-sizing: border-box;
  635. text-decoration: none;
  636. line-height: 1.35;
  637. overflow: hidden;
  638. color: #666666;
  639. /* background-color: #fff; */
  640. background-color: rgba(255, 255, 255, 0) !important;
  641. width: 100%;
  642. height: 100%;
  643. }
  644. .btn-bg {
  645. width: 64px;
  646. height: 28px;
  647. background: linear-gradient(90deg, #cda26e 0%, #dcb78a 100%);
  648. border-radius: 28px;
  649. text-align: center;
  650. line-height: 28px;
  651. margin-top: 10upx;
  652. color: '#604320';
  653. }
  654. body {
  655. background: #f5f5f5;
  656. }
  657. /* #ifndef MP-WEIXIN */
  658. page {
  659. background: #f2eded;
  660. }
  661. /* #endif */
  662. .content {
  663. width: 100%;
  664. }
  665. .btn {
  666. font-size: 24upx;
  667. /* width: 95%; */
  668. text-align: center;
  669. background: #ffffff;
  670. margin-top: 6rpx;
  671. }
  672. .head {
  673. /* width: 100%; */
  674. /* height: 200rpx; */
  675. display: flex;
  676. align-items: center;
  677. padding: 30rpx;
  678. border-radius: 16rpx;
  679. background-image: linear-gradient(#fefbda, #f7f7f7);
  680. }
  681. .head_image {
  682. }
  683. .head_image > image {
  684. width: 90rpx;
  685. height: 90rpx;
  686. border-radius: 50%;
  687. }
  688. .head_name {
  689. margin-left: 10rpx;
  690. }
  691. .name {
  692. font-size: 38rpx;
  693. font-weight: bold;
  694. }
  695. .approve {
  696. position: absolute;
  697. top: 100rpx;
  698. font-size: 24rpx;
  699. color: #999999;
  700. }
  701. /* 列表 */
  702. .use_list {
  703. width: 100%;
  704. background: #ffffff;
  705. margin-top: 20rpx;
  706. }
  707. .list_box {
  708. width: 90%;
  709. margin: 0 auto;
  710. display: flex;
  711. height: 110rpx;
  712. }
  713. .box_left {
  714. flex: 1;
  715. display: flex;
  716. justify-content: left;
  717. align-items: center;
  718. }
  719. .box_right {
  720. flex: 1;
  721. display: flex;
  722. justify-content: flex-end;
  723. align-items: center;
  724. color: #808080;
  725. }
  726. .use_name {
  727. margin-left: 30rpx;
  728. font-size: 32rpx;
  729. }
  730. .use_image image {
  731. width: 50rpx;
  732. height: 50rpx;
  733. }
  734. .center {
  735. width: 94%;
  736. /* line-height: 1.5; */
  737. background-color: #ffffff;
  738. border-radius: 18rpx;
  739. margin: 0 auto 0;
  740. display: flex;
  741. justify-content: space-between;
  742. }
  743. .header_text2 {
  744. font-size: 24rpx;
  745. font-weight: 500;
  746. color: #999999;
  747. margin-top: 10rpx;
  748. }
  749. .header_text4 {
  750. font-size: 32rpx;
  751. font-weight: bold;
  752. color: #333333;
  753. }
  754. .serviceBtn {
  755. position: fixed;
  756. right: 52rpx;
  757. bottom: 50rpx;
  758. display: flex;
  759. flex-direction: column;
  760. align-items: center;
  761. justify-content: center;
  762. width: 140rpx;
  763. height: 140rpx;
  764. border-radius: 50%;
  765. color: #fff;
  766. font-size: 20rpx;
  767. background-color: #3e8ef7;
  768. box-shadow: 0 0 7rpx #000;
  769. }
  770. .serviceBtn_text {
  771. margin-top: 5rpx;
  772. }
  773. </style>