|
|
@@ -5,12 +5,11 @@
|
|
|
<!-- 页面标题-end -->
|
|
|
<!-- 用户信息 -->
|
|
|
<view class="userinfo flex_r flex_ac">
|
|
|
- <span v-if="!userinfo.headimgurl" class="iconfont"></span>
|
|
|
- <image v-else class="user_img" :src="userinfo.headimgurl" mode=""></image>
|
|
|
+ <image class="user_img" :src="userinfo.head_pic" mode=""></image>
|
|
|
<view class="user_info flex_c flex_jc">
|
|
|
- <view class="user_name">{{userinfo.headimgurl}}</view>
|
|
|
+ <view class="user_name">{{ userinfo.nickname }}</view>
|
|
|
<view class="level_con flex_r flex_ac">
|
|
|
- <view class="level">{{userinfo.level_name}}</view>
|
|
|
+ <view class="level">{{ userinfo.level_name }}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- <view class="record flex_r flex_ac flex_jc" @tap="NavToSignList">积分记录</view> -->
|
|
|
@@ -37,26 +36,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<!-- 签到信息-end -->
|
|
|
- <!-- 积分兑好礼 -->
|
|
|
- <view class="integral mar_t30" v-if="list.length != 0 && list[0] != ''">
|
|
|
- <view class="inte_title flex_r flex_ae flex_jb">
|
|
|
- 积分兑好礼
|
|
|
- <view class="more flex_r flex_ac" @tap="goToIntegralList">更多
|
|
|
- <text class="not_ico iconfont"></text>
|
|
|
- <!-- <image class="more_img" src="/static/sgin/more.png" mode=""></image> -->
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="inte_con mar_t30 flex_r flex_ac">
|
|
|
- <view class="inte_goods" v-for="(item,index) in list" :key="index" @tap="openConversion(item.goodsId)">
|
|
|
- <image class="goods_img" :src="item.goodsThumbnailUrl" mode=""></image>
|
|
|
- <view class="goods_name ellipsis">{{item.goodsName}}</view>
|
|
|
- <view class="goods_price">{{item.integral}}<text>积分</text></view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <!-- 积分兑好礼-end -->
|
|
|
+
|
|
|
<!-- 精品推荐 -->
|
|
|
- <view class="Boutique" v-if="goods.length != 0 && goods[0] != ''">
|
|
|
+ <view class="Boutique" v-if="goods.length">
|
|
|
<view class="bou_head flex_r flex_ac flex_jc">
|
|
|
<image class="bou_img" src="/static/sgin/left.png" mode=""></image>
|
|
|
<view class="bou_title">精品推荐</view>
|
|
|
@@ -64,20 +46,17 @@
|
|
|
</view>
|
|
|
<view class="bou_con flex_r flex_ac flex_wrap">
|
|
|
<view class="bou_list" v-for="(item,index) in goods" :key="index" @tap="openConversion(item.goodsId)">
|
|
|
- <image class="bou_l_img" :src="item.goodsThumbnailUrl" mode=""></image>
|
|
|
+ <image class="bou_l_img" :src="item.original_img" mode=""></image>
|
|
|
<view class="bou_l_con">
|
|
|
- <view class="bou_l_name ellipsis">{{item.goodsName}}</view>
|
|
|
- <!-- <view class="bou_l_info flex_r flex_ae mar_t16">
|
|
|
- <view class="bou_l_price flex_r flex_ae"><text>¥</text>450</view>
|
|
|
- <view class="bou_l_cost">¥414</view>
|
|
|
- </view> -->
|
|
|
- <view class="bou_l_msg">{{item.integral}}积分可兑换</view>
|
|
|
+ <view class="bou_l_name ellipsis">{{item.goods_name}}</view>
|
|
|
+ <view class="bou_l_msg">{{item.give_cha_bao}}茶宝</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class='fz_w_text mar_b20 mar_t20'>茶,让生活更美好!</view>
|
|
|
<!-- 精品推荐-end -->
|
|
|
+
|
|
|
<!-- 兑换弹窗 -->
|
|
|
<uni-popup type="center" ref="conversion">
|
|
|
<view class="const_con">
|
|
|
@@ -119,7 +98,7 @@
|
|
|
</uni-popup>
|
|
|
<!-- 兑换弹窗-end -->
|
|
|
<!-- 授权 -->
|
|
|
- <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authSuccess="onAuthSuccess" @onGotUserInfo="onGotUserInfo"></authorize-module>
|
|
|
+ <!-- <authorize-module v-if="showAuth" :shopInfo="shopInfo" @authSuccess="onAuthSuccess" @onGotUserInfo="onGotUserInfo"></authorize-module> -->
|
|
|
<!-- 授权-end -->
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -129,16 +108,18 @@ let page = 1;
|
|
|
let app = getApp();
|
|
|
var appEv = app.$vm.$options;
|
|
|
import uniPopup from '@/components/uni-popup/uni-popup.vue'
|
|
|
-import authorizeModule from '@/components/authorize-module/index'
|
|
|
+// import authorizeModule from '@/components/authorize-module/index'
|
|
|
import { get, post, u_post } from "@/request/api.js";
|
|
|
export default {
|
|
|
- components: { uniPopup, authorizeModule },
|
|
|
+ components: {
|
|
|
+ uniPopup,
|
|
|
+ // authorizeModule
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
integerInfo: {}, // 积分详情
|
|
|
userInof: {}, // 用户详情
|
|
|
timer: '00:00:00', // 倒计时
|
|
|
- list: [], // 积分兑好礼
|
|
|
goods: [], // 精品推荐
|
|
|
haveGoods: false, // 是否有商品
|
|
|
way_list: [], //兑换方式
|
|
|
@@ -147,7 +128,7 @@ export default {
|
|
|
pay_way: 0, //选中的支付方式
|
|
|
isShow: false, // 是否显示现金支付
|
|
|
goodsId: '', // 选中的商品Id
|
|
|
- showAuth: false, //是否显示授权弹窗
|
|
|
+ // showAuth: false, //是否显示授权弹窗
|
|
|
shopInfo: {}, // 商户信息
|
|
|
userinfo:undefined, //用户信息
|
|
|
todaySign:0, //今日签到数
|
|
|
@@ -158,24 +139,11 @@ export default {
|
|
|
onShow: function() {
|
|
|
this.timer = '00:00:00'
|
|
|
this.userinfo = uni.getStorageSync("userinfo")
|
|
|
- console.log( this.userinfo,' this.userinfo');
|
|
|
+
|
|
|
+ console.log("this.userinfo",this.userinfo);
|
|
|
this.loadData()
|
|
|
- // this.goodsDay()
|
|
|
- // this.getInteGoods()
|
|
|
- // this.integralMethodChange()
|
|
|
- // let userId = app.globalData.systemUserInfo && app.globalData.systemUserInfo.userId ? app.globalData.systemUserInfo.userId : '';
|
|
|
- if (!this.userinfo || this.userinfo == '' || this.userinfo == undefined) {
|
|
|
- this.showAuth = true
|
|
|
- appEv.authorizeUserInfo(res => {
|
|
|
- if (res) {
|
|
|
- this.showAuth = false
|
|
|
- this.shopInfo = app.globalData.shopInfo
|
|
|
- }
|
|
|
- }, true)
|
|
|
- } else {
|
|
|
- this.showAuth = false
|
|
|
- this.shopInfo = app.globalData.shopInfo
|
|
|
- }
|
|
|
+
|
|
|
+ this.goodsDay()
|
|
|
},
|
|
|
onHide: function() {
|
|
|
clearInterval(tim)
|
|
|
@@ -194,15 +162,15 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
//授权并登录
|
|
|
- onAuthSuccess: function() {
|
|
|
- var that = this;
|
|
|
- uni.showLoading({ mask: true })
|
|
|
- appEv.setData((res) => {
|
|
|
- uni.hideLoading()
|
|
|
- that.loadData()
|
|
|
- that.showAuth = false
|
|
|
- });
|
|
|
- },
|
|
|
+ // onAuthSuccess: function() {
|
|
|
+ // var that = this;
|
|
|
+ // uni.showLoading({ mask: true })
|
|
|
+ // appEv.setData((res) => {
|
|
|
+ // uni.hideLoading()
|
|
|
+ // that.loadData()
|
|
|
+ // that.showAuth = false
|
|
|
+ // });
|
|
|
+ // },
|
|
|
// 距可以签到倒计时
|
|
|
setTime() {
|
|
|
var date;
|
|
|
@@ -220,13 +188,12 @@ export default {
|
|
|
let sec = parseInt(timer % 60) > 9 ? parseInt(timer % 60) : '0' + parseInt(timer % 60)
|
|
|
|
|
|
date = hour + ':' + min + ':' + sec;
|
|
|
- console.log(date);
|
|
|
+ // console.log(date);
|
|
|
this.timer = date
|
|
|
}, 999)
|
|
|
},
|
|
|
// 签到
|
|
|
setSignIn() {
|
|
|
- console.log("走了这里");
|
|
|
post("user/doSign").then(res => {
|
|
|
if (res.status == 200) {
|
|
|
appEv.errTips(res.msg)
|
|
|
@@ -236,34 +203,22 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 获取积分兑好礼商品列表
|
|
|
- getInteGoods: function() {
|
|
|
- let that = this;
|
|
|
- let data = {
|
|
|
- page: 1,
|
|
|
- limit: 3
|
|
|
- }
|
|
|
- post("ShuZiTeaIntegral/integral/goods", data).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- that.list = res.goods
|
|
|
- } else {
|
|
|
- appEv.errTips(res.msg)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
// 获取精品推荐
|
|
|
goodsDay: function() {
|
|
|
let that = this;
|
|
|
let data = {
|
|
|
page: page,
|
|
|
- limit: 10
|
|
|
+ type: 3
|
|
|
}
|
|
|
- post("ShuZiTeaIntegral/integral/goodsDay", data).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- let obj = res.goods
|
|
|
- that.goods = []
|
|
|
+ post("goods/goodsList", data).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ let obj = res.data.data
|
|
|
+ if(page == 1) that.goods = []
|
|
|
if (obj.length > 0) {
|
|
|
- that.goods = [...that.goods,...obj]
|
|
|
+ obj.forEach(e => {
|
|
|
+ that.goods.push(e)
|
|
|
+ });
|
|
|
} else {
|
|
|
if (page == 1) {
|
|
|
that.haveGoods = true
|
|
|
@@ -439,7 +394,7 @@ page {
|
|
|
|
|
|
.user_name {
|
|
|
font-size: 30rpx;
|
|
|
- color: #fff;
|
|
|
+ color: #333;
|
|
|
font-family: "SourceHanSansSC-Medium";
|
|
|
font-weight: 500;
|
|
|
margin-bottom: 18rpx;
|