index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="page" :style="{'height':height}">
  3. <view class="backImage">
  4. <image class="backImage" src="/static/me/u655.png"></image>
  5. </view>
  6. <view class="content">
  7. <view class="userInfo flex-row justify-between ">
  8. <view class="flex-row">
  9. <view class="userPhoto" @click="navigateToPage('/myPages/userInfo/index')">
  10. <image class="userPhoto" :src="userInfo.selfPhotoUrl || '/static/me/ud4.png'"></image>
  11. </view>
  12. <view class="userTitle flex-col justify-center" @click="navigateToPage('/myPages/userInfo/index')">
  13. <text class="nickName">{{userInfo.no}}</text>
  14. <text class="xinxTitle">{{ userInfo.ncikName }}</text>
  15. <text class="xinxTitle">{{userInfo.phone || '暂无绑定手机号'}}</text>
  16. </view>
  17. </view>
  18. <view class="qrcodeView flex-col justify-center" @click="navigateToPage('/pages/qrCode/index')">
  19. <image class="qrcode" src="/static/me/u5.png"></image>
  20. <text class="qrcodeTitle">会员码</text>
  21. </view>
  22. </view>
  23. <view class="sudoku flex-col">
  24. <view class="balance-name">
  25. <text>我的资产</text>
  26. </view>
  27. <view class="balance flex-row justify-around">
  28. <view class="balanceItem" @click="navigateToPage('/myPages/recharge/index')">
  29. <view class="icon flex-row justify-center">
  30. <u-icon name="/static/me/u701.png" color="red" size="30"></u-icon>
  31. </view>
  32. <view class="name">
  33. 余额
  34. </view>
  35. <view class="num">
  36. <text>{{ userInfo.balance || 0 }}</text>
  37. </view>
  38. </view>
  39. <view class="balanceItem">
  40. <view class="icon flex-row justify-center">
  41. <u-icon name="/static/me/u680.png" color="red" size="30"></u-icon>
  42. </view>
  43. <view class="name">
  44. 积分
  45. </view>
  46. <view class="num">
  47. <text>{{ userInfo.integral || 0 }}</text>
  48. </view>
  49. </view>
  50. <view class="balanceItem" @click="navigateToPage('/orderPages/myCoupon/index')">
  51. <view class="icon flex-row justify-center">
  52. <u-icon name="/static/me/u687.png" color="red" size="30"></u-icon>
  53. </view>
  54. <view class="name">
  55. 优惠券
  56. </view>
  57. <view class="num">
  58. <text>{{ userInfo.coupon || 0 }}</text>
  59. </view>
  60. </view>
  61. <view class="balanceItem" @click="navigateToPage('/storePages/myRights/index')">
  62. <view class="icon flex-row justify-center">
  63. <u-icon name="/static/me/u694.png" color="red" size="30"></u-icon>
  64. </view>
  65. <view class="name">
  66. 我的权益卡
  67. </view>
  68. <view class="num">
  69. <text>{{ userInfo.equityCardTotal || 0 }}</text>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="group">
  75. <uni-list>
  76. <uni-list-item :clickable="true" :title="item.title" showArrow :thumb="item.thumb" thumb-size="sm"
  77. :rightText="item.rightText" v-for="(item,index) in group1" :key="index" @click="clickListItem(item)">
  78. <template v-if="item.isShowRed" v-slot:footer>
  79. <view class="flex-col justify-center">
  80. <uni-icons size="12" color="red" type="smallcircle-filled"></uni-icons>
  81. </view>
  82. </template>
  83. </uni-list-item>
  84. </uni-list>
  85. </view>
  86. <!-- <view class="group">-->
  87. <!-- <uni-list>-->
  88. <!-- <uni-list-item :to="item.to" :title="item.title" showArrow :thumb="item.thumb" thumb-size="sm" v-for="(item,index) in group2" :key="index" />-->
  89. <!-- </uni-list>-->
  90. <!-- </view>-->
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import tabBar from "../../components/tabBar/tabBar";
  96. export default {
  97. components: {
  98. tabBar
  99. },
  100. data() {
  101. return {
  102. group1: [
  103. // {thumb:'/static/me/u1796.png',title:'贡献奖励记录',rightText:'',to:''},
  104. // {thumb:'/static/me/u1803.png',title:'实名认证',rightText:'',to:'/myPages/realNameAuth/index'},
  105. {thumb: '/static/me/u1812.png', title: '服务对象管理', rightText: '', to: '/myPages/ServiceObjectManagement/index'},
  106. {thumb: '/static/me/u3.png', title: '邀请有礼', rightText: '', to: '/myPages/promotionCenter/index'},
  107. {thumb: '/static/me/u1833.png', title: '会员转入', rightText: '', to: '/myPages/systemSwitch/index'},
  108. {thumb: '/static/me/u826.png', title: '储值服务', rightText: '', to: '/myPages/recharge/index'},
  109. {thumb: '/static/me/u701.png', title: '交易记录', rightText: '', to: '/myPages/transactionRecord/index'},
  110. {thumb: '/static/me/u11.png', title: '会员须知', rightText: '', to: '/myPages/aboutOur/index'},
  111. {thumb: '/static/me/familyCard_icon.png', title: '亲情卡', rightText: '', to: '/myPages/familyCard/index' ,isShowRed:false},
  112. {thumb: '/static/me/hd.png', title: '我的活动', rightText: '', to: '/myPages/myActivity/myActivity'}
  113. ],
  114. group2: [
  115. // {thumb:'/static/me/u10.png',title:'个人信息',rightText:'',to:'/myPages/userInfo/index'},
  116. // {thumb:'/static/me/u101.png',title:'设置',rightText:'',to:'/myPages/setting/index'}
  117. ],
  118. height: '',
  119. title: 'Hello',
  120. tabIndex: 4,
  121. userInfo: {}
  122. }
  123. },
  124. // 分享到朋友圈
  125. onShareTimeline() {
  126. },
  127. // 分享到用户
  128. onShareAppMessage(OBJECT) {
  129. },
  130. onLoad() {
  131. //
  132. // uni.hideTabBar({
  133. // animation: false
  134. // })
  135. let sysInfo = uni.getSystemInfoSync()
  136. this.height = sysInfo.windowHeight + 'px'
  137. },
  138. onShow() {
  139. // this.userInfo = uni.getStorageSync('userInfo')
  140. // if (this.userInfo.isAttestation){
  141. // this.group1[0].rightText = '已认证'
  142. // }else {
  143. // this.group1[0].rightText = '未实名认证,去认证'
  144. // }
  145. this.getUserInfo()
  146. this.notReadRecordList()
  147. },
  148. methods: {
  149. notReadRecordList(){
  150. this.$api.notReadRecordList().then(res=>{
  151. if (res.data.data.length > 0){
  152. this.group1[6].isShowRed = true
  153. }else {
  154. this.group1[6].isShowRed = false
  155. }
  156. })
  157. },
  158. getTemplateList(){
  159. let that = this
  160. that.$api.getTemplateList({
  161. type:2
  162. }).then(res=>{
  163. let templateId = res.data.data.data.map(item=>{
  164. return item.priTmplId
  165. })
  166. uni.requestSubscribeMessage({
  167. tmplIds: templateId,
  168. success: (res) =>{
  169. console.log('+++++++++success++++++++',res)
  170. let {errMsg,...param} = res
  171. that.$api.updateSubscribe(param).then(res=>{
  172. console.log('+++++++++++++updateSubscribe+++++++++++++',res)
  173. })
  174. },
  175. fail:(err)=>{
  176. console.log('+++++++++++++fail+++++++++++++',err)
  177. },
  178. complete:(complete)=>{
  179. }
  180. })
  181. })
  182. },
  183. clickListItem(e){
  184. if (e.title === '亲情卡'){
  185. let store = uni.getStorageSync('storeInfo')
  186. this.$api.checkStore({
  187. storeName:store.storeName
  188. }).then(res=>{
  189. uni.navigateTo({
  190. url:e.to
  191. })
  192. })
  193. }else if (e.title === '服务对象管理'){
  194. uni.navigateTo({
  195. url:e.to
  196. })
  197. this.getTemplateList()
  198. }else {
  199. uni.navigateTo({
  200. url:e.to
  201. })
  202. }
  203. },
  204. getUserInfo() {
  205. this.$api.getUserInfo().then(res => {
  206. console.log('++++++++++++获取用户信息++++++++++++++++++', res)
  207. uni.setStorageSync('userInfo', res.data.data)
  208. this.userInfo = res.data.data
  209. this.getImgUrlByOssId(this.userInfo.selfPhoto)
  210. })
  211. },
  212. getImgUrlByOssId(Id) {
  213. if (Id) {
  214. this.$api.getImage(Id).then(res => {
  215. this.userInfo.selfPhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
  216. this.$set(this.userInfo)
  217. });
  218. }
  219. },
  220. navigateToPage(url) {
  221. uni.navigateTo({
  222. url: url
  223. })
  224. },
  225. }
  226. }
  227. </script>
  228. <style>
  229. @import '/common/css/common.css';
  230. @import './index.rpx.css';
  231. </style>