作者 倪静楠

3/4

1 <template> 1 <template>
2 - <view class="" style="background-color: #f7f8fa; width: 100%;padding-bottom: 424rpx;"> 2 + <view class="" style="background-color: #f7f8fa; width: 100%;padding-bottom: 424rpx;" v-if="goodsData.name">
3 <view class=""> 3 <view class="">
4 <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration" 4 <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration"
5 :circular="true"> 5 :circular="true">
@@ -65,10 +65,17 @@ @@ -65,10 +65,17 @@
65 export default { 65 export default {
66 onLoad(options) { 66 onLoad(options) {
67 this.id = options.id 67 this.id = options.id
68 - this.detail() 68 + this.tabindex=options.index
  69 + if(options.index==1){
  70 + this.detail()
  71 + }else{
  72 + this.goodsDetail()
  73 + }
  74 +
69 }, 75 },
70 data() { 76 data() {
71 return { 77 return {
  78 + tabindex:'', //判断活动/商品
72 id: '', 79 id: '',
73 indicatorDots: true, 80 indicatorDots: true,
74 autoplay: false, 81 autoplay: false,
@@ -91,7 +98,6 @@ @@ -91,7 +98,6 @@
91 lis_id: this.id 98 lis_id: this.id
92 } 99 }
93 request.get('/api/personal/detail', dataParam).then(res => { 100 request.get('/api/personal/detail', dataParam).then(res => {
94 - console.log(res)  
95 this.swiperList = res.data.images 101 this.swiperList = res.data.images
96 this.goodsData = res.data 102 this.goodsData = res.data
97 var richtext = res.data.content 103 var richtext = res.data.content
@@ -101,6 +107,22 @@ @@ -101,6 +107,22 @@
101 }).catch(err => { 107 }).catch(err => {
102 108
103 }) 109 })
  110 + },
  111 + //兑换商品详情
  112 + goodsDetail(){
  113 + let dataParam = {
  114 + id: this.id
  115 + }
  116 + request.get('/api/convert/duiDetail', dataParam).then(res => {
  117 + this.swiperList = res.data.images
  118 + this.goodsData = res.data
  119 + var richtext = res.data.content
  120 + const regex = new RegExp('<img', 'gi');
  121 + richtext = richtext.replace(regex, `<img style="max-width: 100%;display:block"`)
  122 + this.content = richtext
  123 + }).catch(err => {
  124 +
  125 + })
104 } 126 }
105 } 127 }
106 } 128 }
@@ -79,7 +79,7 @@ @@ -79,7 +79,7 @@
79 //活动 79 //活动
80 goGroupCluster(id) { 80 goGroupCluster(id) {
81 uni.navigateTo({ 81 uni.navigateTo({
82 - url: "/myPackage/pages/me/cluster?id=" + id 82 + url: "/myPackage/pages/me/cluster?id=" + id+'&index=1'
83 }) 83 })
84 }, 84 },
85 listData() { 85 listData() {
@@ -121,7 +121,7 @@ @@ -121,7 +121,7 @@
121 goGroupDetail(id) { 121 goGroupDetail(id) {
122 console.log(id) 122 console.log(id)
123 uni.navigateTo({ 123 uni.navigateTo({
124 - url:'/pages/activity/exchange-detail?id='+id 124 + url:'/myPackage/pages/me/cluster?id='+id+'&index=2'
125 }) 125 })
126 } 126 }
127 }, 127 },
@@ -4,12 +4,12 @@ @@ -4,12 +4,12 @@
4 <view class="AllTop"> 4 <view class="AllTop">
5 <view class="AllUser"> 5 <view class="AllUser">
6 <view class="userTop"> 6 <view class="userTop">
7 - <view class="userImg"> 7 + <view class="userImg" @click="goUSER">
8 <image :src="userData.avatar" style="width: 120rpx;height: 120rpx;border-radius: 50%;" mode=""></image> 8 <image :src="userData.avatar" style="width: 120rpx;height: 120rpx;border-radius: 50%;" mode=""></image>
9 </view> 9 </view>
10 <view class="userNav"> 10 <view class="userNav">
11 <text class="userNavTex" v-if="!token" @click="login">请登录</text> 11 <text class="userNavTex" v-if="!token" @click="login">请登录</text>
12 - <text class="userNavTex">{{userData.nickname}}</text> 12 + <text class="userNavTex" @click="goUSER">{{userData.nickname}}</text>
13 <view class="userNavPic" @click="onMerber"> 13 <view class="userNavPic" @click="onMerber">
14 <image src="/static/image/zuanshi_icon_1@2x.png" style="width: 24rpx;height:24rpx;margin-top: 6rpx;" mode=""></image> 14 <image src="/static/image/zuanshi_icon_1@2x.png" style="width: 24rpx;height:24rpx;margin-top: 6rpx;" mode=""></image>
15 <text class="userNavPicTex">{{userData.grade_status==0?'L0':userData.grade_status==1?'L1':userData.grade_status==2?'L2':userData.grade_status==3?'L3':userData.grade_status==4?'L4':userData.grade_status==5?'L5':'L0'}}</text> 15 <text class="userNavPicTex">{{userData.grade_status==0?'L0':userData.grade_status==1?'L1':userData.grade_status==2?'L2':userData.grade_status==3?'L3':userData.grade_status==4?'L4':userData.grade_status==5?'L5':'L0'}}</text>
@@ -232,6 +232,13 @@ @@ -232,6 +232,13 @@
232 uni.setStorageSync('ipone', that.isIphoneX) 232 uni.setStorageSync('ipone', that.isIphoneX)
233 }, 233 },
234 methods: { 234 methods: {
  235 + //主页
  236 + goUSER(){
  237 + let id=uni.getStorageSync('userInfo').id
  238 + uni.navigateTo({
  239 + url:'/pages/index/user-page?id='+id
  240 + })
  241 + },
235 // 242 //
236 login() { 243 login() {
237 uni.navigateTo({ 244 uni.navigateTo({
@@ -11,16 +11,16 @@ @@ -11,16 +11,16 @@
11 <view class="inputBox"> 11 <view class="inputBox">
12 <view class="inputItem"> 12 <view class="inputItem">
13 姓名 13 姓名
14 - <input type="text" value="" placeholder="请填写您的姓名" class="inputs" @input="nameChange" v-model="nameInput" /> 14 + <input type="text" value="" placeholder="请填写您的姓名" class="inputs" @input="nameChange" v-model="nameInput" style="margin-left:74rpx;margin-top: 4rpx;"/>
15 </view> 15 </view>
16 <view class="inputItem"> 16 <view class="inputItem">
17 联系方式 17 联系方式
18 - <input type="text" value="" placeholder="请填写您的联系方式" style="margin-left: 20rpx;" @input="phoneChange" v-model="phoneInput" 18 + <input type="text" value="" placeholder="请填写您的联系方式" style="margin-left: 20rpx;margin-top: 4rpx;" @input="phoneChange" v-model="phoneInput"
19 @blur="blurPhone" /> 19 @blur="blurPhone" />
20 </view> 20 </view>
21 <view class="inputItem"> 21 <view class="inputItem">
22 邮寄地址 22 邮寄地址
23 - <input type="text" value="" placeholder="请填写您的地址" class="inputs" @input="remarkChange" v-model="remark" /> 23 + <input type="text" value="" placeholder="请填写您的地址" class="inputs" @input="remarkChange" v-model="remark" style="margin-top: 4rpx;"/>
24 </view> 24 </view>
25 </view> 25 </view>
26 <view class="bottomBtn"> 26 <view class="bottomBtn">
1 <template> 1 <template>
2 - <view class="container"> 2 + <view class="container" v-if="userData.info[0].nickname">
3 <view class="pagetopBj"> 3 <view class="pagetopBj">
4 </view> 4 </view>
5 <view class="goback" @click="goBack"> 5 <view class="goback" @click="goBack">
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 <view class="topTitle"> 7 <view class="topTitle">
8 个人主页 8 个人主页
9 </view> 9 </view>
10 - <view class="userBox" style="background-color: #F7F8FA;" v-if="userData.info[0].avatar"> 10 + <view class="userBox" style="background-color: #F7F8FA;" >
11 <image :src="userData.info[0].avatar" mode="" class="userPageHead"></image> 11 <image :src="userData.info[0].avatar" mode="" class="userPageHead"></image>
12 <view class="" style="display: flex;margin-left: 200rpx;justify-content: space-between;"> 12 <view class="" style="display: flex;margin-left: 200rpx;justify-content: space-between;">
13 <view class=""> 13 <view class="">