index.vue 23 KB

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