center.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <template>
  2. <view>
  3. <view style="background-color:#E75F37;height: 250rpx;">
  4. <view style="padding: 33rpx;display: flex;align-items: center;">
  5. <view class="">
  6. <image src="/static/images/tabBar/head.png" style="width:100rpx;height: 100rpx;" mode="scaleToFill">
  7. </image>
  8. </view>
  9. <view style="color:#fff;margin-left: 13rpx;font-size: 30rpx;font-weight: 500;">
  10. {{name?name:''}}
  11. </view>
  12. </view>
  13. </view>
  14. <view class="card" style="height: 114rpx;">
  15. <view style="display: flex;justify-content: space-around;align-items: center;height: 114rpx;">
  16. <text style="color:#818181;font-size: 24rpx;">
  17. 产生积分:
  18. <text style="color:#FE8301;font-size: 26rpx;">
  19. {{form.addPoints?form.addPoints:'0.00'}}
  20. </text>
  21. </text>
  22. <text style="color:#818181;font-size: 24rpx;">
  23. 使用积分:
  24. <text style="color:#FE8301;font-size: 26rpx;">
  25. {{form.subPoints?form.subPoints:'0.00'}}
  26. </text>
  27. </text>
  28. <text style="color:#818181;font-size: 24rpx;">
  29. 余额:
  30. <text style="color:#FE8301;font-size: 26rpx;">
  31. {{form.pointsBalance?form.pointsBalance:'0.00'}}
  32. </text>
  33. </text>
  34. </view>
  35. </view>
  36. <view class="card" style="margin-top: 20rpx;height: 141rpx;">
  37. <view style="display: flex;justify-content: space-around;align-items: center;height: 141rpx;">
  38. <view style="display: flex;flex-direction:column;align-items: center;" @click="clickIntegralOrder">
  39. <image src="/static/images/tabBar/280-1.png" style="width:40rpx;height: 40rpx;" mode="scaleToFill">
  40. </image>
  41. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">积分订单
  42. <uni-icons type="right" size="13" color='#8A8A8A'></uni-icons>
  43. </view>
  44. </view>
  45. <view style="display: flex;flex-direction:column;align-items: center;" @click="inIntegralMall">
  46. <image src="/static/images/tabBar/280-2.png" style="width:40rpx;height: 40rpx;" mode="scaleToFill">
  47. </image>
  48. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;" >积分商城
  49. <uni-icons type="right" size="13" color='#8A8A8A'></uni-icons>
  50. </view>
  51. </view>
  52. <view style="display: flex;flex-direction:column;align-items: center;" @click="RedemptionOfPoints">
  53. <image src="/static/images/tabBar/280-3.png" style="width:40rpx;height: 40rpx;" mode="scaleToFill">
  54. </image>
  55. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">我的积分
  56. <uni-icons type="right" size="13" color='#8A8A8A'></uni-icons>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="card" style="margin-top: 20rpx;height: 238rpx;padding: 20rpx 0;">
  62. <u-cell-group :border="false">
  63. <u-cell title="我的订单" value="查看全部订单" :border="false" :clickable="false" @click="pageJump('')">
  64. <view slot="right-icon">
  65. <uni-icons type="right" size="18" color='#D2D2D2'></uni-icons>
  66. </view>
  67. </u-cell>
  68. </u-cell-group>
  69. <view style="display: flex;justify-content: space-around;">
  70. <view style="display: flex;flex-direction:column;align-items: center;" @click="obligationBtn('待付款')">
  71. <image src="/static/images/tabBar/280@2x(1).png" style="width:81rpx;height: 81rpx;"
  72. mode="scaleToFill">
  73. </image>
  74. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待付款</view>
  75. </view>
  76. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('待发货')">
  77. <image src="/static/images/tabBar/280@2x(2).png" style="width:81rpx;height: 81rpx;"
  78. mode="scaleToFill">
  79. </image>
  80. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待发货</view>
  81. </view>
  82. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('待收货')">
  83. <image src="/static/images/tabBar/280@2x(3).png" style="width:81rpx;height: 81rpx;"
  84. mode="scaleToFill">
  85. </image>
  86. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待收货</view>
  87. </view>
  88. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('已收货')">
  89. <image src="/static/images/tabBar/280@2x(4).png" style="width:81rpx;height: 81rpx;"
  90. mode="scaleToFill">
  91. </image>
  92. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">已完成</view>
  93. </view>
  94. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('退款售后')">
  95. <image src="/static/images/tabBar/280@2x(5).png" style="width:81rpx;height: 81rpx;"
  96. mode="scaleToFill">
  97. </image>
  98. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">退款/售后</view>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="card2" style="margin-top: 20rpx;display: flex;align-items: center;">
  103. <u-cell-group :border="false">
  104. <u-cell title="个人资料" :clickable="true" @click="clickMeans">
  105. <view slot="icon">
  106. <image src="/static/images/tabBar/100.png"
  107. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  108. </image>
  109. </view>
  110. <view slot="right-icon">
  111. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  112. </view>
  113. </u-cell>
  114. <u-cell title="员工信息" :clickable="true" @click="clickContacts">
  115. <view slot="icon">
  116. <image src="/static/images/tabBar/101.png"
  117. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  118. </image>
  119. </view>
  120. <view slot="right-icon">
  121. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  122. </view>
  123. </u-cell>
  124. <u-cell title="地址管理" :clickable="true" @click="clickAddress">
  125. <view slot="icon">
  126. <image src="/static/images/tabBar/102.png"
  127. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  128. </image>
  129. </view>
  130. <view slot="right-icon">
  131. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  132. </view>
  133. </u-cell>
  134. <u-cell title="设置" :clickable="true" :border="false" @click="setUp">
  135. <view slot="icon">
  136. <image src="/static/images/tabBar/103.png"
  137. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  138. </image>
  139. </view>
  140. <view slot="right-icon">
  141. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  142. </view>
  143. </u-cell>
  144. </u-cell-group>
  145. </view>
  146. <!-- 提取去登录 -->
  147. <u-modal :show="adminShow" :showCancelButton="true" content='当前还未登录请先登录!!' @confirm="adminConfirm"
  148. @cancel="adminCancel"></u-modal>
  149. </view>
  150. </template>
  151. <script>
  152. import {
  153. details,
  154. corpPointsDetail
  155. } from '@/api/views/personalInformation/index.js'
  156. export default {
  157. data() {
  158. return {
  159. name: null,
  160. badgeList: [],
  161. form: {},
  162. adminShow: false,
  163. }
  164. },
  165. onShow() {
  166. this.getUpdate()
  167. if (uni.getStorageSync('userInfo').tenant_id == '000000') {
  168. this.adminShow = true
  169. }
  170. details().then(res => {
  171. this.name = res.data.cname
  172. corpPointsDetail({
  173. corpId: res.data.id
  174. }).then(res => {
  175. this.form = res.data
  176. })
  177. })
  178. },
  179. methods: {
  180. getUpdate() {
  181. const updateManager = uni.getUpdateManager();
  182. updateManager.onCheckForUpdate(function(res) {
  183. // 请求完新版本信息的回调
  184. if (res.hasUpdate) {
  185. updateManager.onUpdateReady(function() {
  186. uni.showModal({
  187. title: '更新提示',
  188. content: '新版本已经准备好,是否重启应用?',
  189. success: function(res) {
  190. if (res.confirm) {
  191. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  192. updateManager.applyUpdate();
  193. }
  194. }
  195. });
  196. });
  197. updateManager.onUpdateFailed(function() {
  198. // 新的版本下载失败
  199. uni.showModal({
  200. title: '已经有新版本了哟~',
  201. content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  202. });
  203. });
  204. }
  205. });
  206. },
  207. // 确认
  208. adminConfirm() {
  209. uni.clearStorageSync();
  210. uni.redirectTo({
  211. url: '/pages/login/login'
  212. })
  213. },
  214. // 取消
  215. adminCancel() {
  216. uni.switchTab({
  217. url: '/pages/tabBar/home'
  218. })
  219. },
  220. clickCall() {
  221. uni.makePhoneCall({
  222. phoneNumber: this.form.contactNumber,
  223. success: function() {
  224. console.log('拨打电话成功');
  225. },
  226. fail() {
  227. console.log('打电话失败了');
  228. }
  229. })
  230. },
  231. setUp() {
  232. this.$u.route('/pages/user/setUp');
  233. },
  234. clickMeans() {
  235. uni.$u.route('/pages/views/personalInformation/index');
  236. },
  237. clickContacts() {
  238. uni.$u.route('/pages/views/personalInformation/contacts');
  239. },
  240. clickAddress() {
  241. this.$u.route('/pages/views/personalInformation/addressManagement');
  242. },
  243. // 车型
  244. clickVehicle() {
  245. this.$u.route('/pages/tabBar/vehicleModel');
  246. },
  247. // 积分商城
  248. clickPointsMall() {
  249. this.$u.route('/pages/tabBar/pointsMall');
  250. },
  251. clickIntegralOrder() {
  252. this.$u.route('/pages/views/salesSlip/IntegralOrder');
  253. },
  254. // 积分兑换记录
  255. RedemptionOfPoints() {
  256. this.$u.route('/pages/tabBar/integralList/index');
  257. },
  258. // 积分获取记录
  259. obtainRecord() {
  260. this.$u.route('/pages/tabBar/integralList/obtainRecord');
  261. },
  262. // 消费记录
  263. consumptionRecord() {
  264. this.$u.route('/pages/tabBar/integralList/consumptionRecord');
  265. },
  266. pageJump(value) {
  267. uni.$u.route('/pages/views/salesSlip/index', {
  268. text: value
  269. });
  270. },
  271. obligationBtn(value) {
  272. uni.$u.route('/pages/views/salesSlip/obligation', {
  273. text: value
  274. });
  275. },
  276. inIntegralMall() {
  277. uni.$u.route('/pages/integralMall/index');
  278. }
  279. }
  280. }
  281. </script>
  282. <style lang="scss" scoped>
  283. .card {
  284. position: relative;
  285. margin: 0 32rpx;
  286. background-color: #fff;
  287. border-radius: 14rpx;
  288. bottom: 96rpx;
  289. ::v-deep .u-cell__title-text {
  290. font-size: 26rpx;
  291. color: #333333;
  292. }
  293. ::v-deep .u-cell__value {
  294. font-size: 24rpx;
  295. color: #CBCBCB;
  296. }
  297. ::v-deep .u-icon__icon--info {
  298. font-size: 28rpx !important;
  299. color: #CBCBCB;
  300. }
  301. }
  302. .card2 {
  303. position: relative;
  304. margin: 0 32rpx;
  305. background-color: #fff;
  306. border-radius: 14rpx;
  307. bottom: 96rpx;
  308. ::v-deep .u-cell__title-text {
  309. font-size: 24rpx;
  310. font-weight: 400;
  311. color: #797979;
  312. }
  313. }
  314. </style>