This commit is contained in:
Gdpao 2020-08-07 19:59:51 +08:00
commit 0290189205
22 changed files with 332 additions and 145 deletions

View File

@ -314,10 +314,25 @@ export default {
goodsShelves({live_id}){
return vm.$u.post('Specialci/goodsShelves',{live_id})
},
//
// 收藏店铺
addFavoriteStore({ id }) {
return vm.$u.post('member/addFavoriteStore',{ fid: id })
},
//店家id获取用户信息
getAtwillUserInfo({ id }) {
return vm.$u.post('Specialci/getAtwillUserInfo',{ store_id: id })
},
// 收藏商品
addFavoriteGoods({ fid }) {
return vm.$u.post('member/addFavoriteGoods',{ fid: fid })
},
// 取消收藏(商品/店铺)
removeFavorite({ fid, type }) {
return vm.$u.post('Member/removeFavorite',{
fav_id: fid,
type: type
})
}
}
}

View File

@ -1,10 +1,11 @@
var md5 = require("../static/js/md5.min.js")
const install = (Vue, vm) => {
// 此为自定义配置参数,具体参数见上方说明
Vue.prototype.$u.http.setConfig({
baseUrl: 'https://dmmall.sdbairui.com/api',
loadingText: '努力加载中~',
loadingTime: 800,
// originalData: true
originalData: true
});
// 请求拦截配置Token等参数
@ -12,20 +13,37 @@ const install = (Vue, vm) => {
const token = uni.getStorageSync('token');
config.header.Authorization = 'Bearer' + " " + token;
config.header.Authorization = 'Bearer' + " " + token;
Date.prototype.Format = function (fmt) { // author: meizz
var o = {
"M+": this.getMonth() + 1, // 月份
"d+": this.getDate(), // 日
"h+": this.getHours(), // 小时
"m+": this.getMinutes(), // 分
"s+": this.getSeconds(), // 秒
"q+": Math.floor((this.getMonth() + 3) / 3), // 季度
"S": this.getMilliseconds() // 毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
let time = new Date().Format("yyyyMMddhhmmss")
config.header.Sign = md5('DBCA4F8DA7BC0BA2' + time) + '-' + time
return config;
}
// 响应拦截,如配置,每次请求结束都会执行本方法
Vue.prototype.$u.http.interceptor.response = (res) => {
if(parseInt(res.errCode) == 0) {
if(parseInt(res.data.errCode) == 0) {
// res为服务端返回值可能有errCoderesult等字段
// 这里对res.result进行返回将会在this.$u.post(url).then(res => {})的then回调中的res的到
// 如果配置了originalData为true请留意这里的返回值
return res;
} else if(res.errCode == 401) {
return res.data;
} else if(res.data.errCode == 401) {
// 假设201为token失效这里跳转登录
// vm.$u.toast('您还没有登录哦,请先去登录!');
if (res.data.action != "memberinfo") {
@ -55,7 +73,7 @@ const install = (Vue, vm) => {
} else {
// 如果返回false则会调用Promise的reject回调
// 并将进入this.$u.post(url).then().catch(res=>{})的catch回调中res为服务端的返回值
return res;
return res.data;
}
}

View File

@ -3,13 +3,13 @@
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action
v-for="(item, index) in list" :key="index"
:index='item.fav_id'
:index='index'
:show="item.show"
:options="options"
@click="removeFavorite"
@open="open"
>
<view class="item u-border-bottom">
<view class="item u-border-bottom" @click="viewGoodsDetails(item)">
<image :src="item.goods_image"></image>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap">
@ -18,7 +18,7 @@
<view class="item-price">{{ item.favlog_price }}</view>
<view class="item-date">
<image src="@/pageE/static/mine/26.png"></image>
<view>{{ item.fav_time }}</view>
<view>{{ item.fav_time | date }}</view>
</view>
</view>
</view>
@ -31,7 +31,6 @@ export default {
data() {
return {
list: [],
show: false,
options: [
{
text: '删除',
@ -46,20 +45,38 @@ export default {
this.getGoodsFavoritesList();
},
methods: {
viewGoodsDetails(item) {
const list = this.list.filter(item => {
return item.show;
})
if(list.length) return false;
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: item.fav_id,
}
})
},
getGoodsFavoritesList() {
this.$u.api.getFavoritesList().then(res => {
if(res.errCode == 0) {
this.list = res.data;
this.list.forEach(item => {
Object.assign(item, { show: false });
})
}
})
},
removeFavorite(id) {
removeFavorite(index) {
const id = this.list[index].fav_id;
this.$u.api.removeFavorite({
id: id
fid: id,
type: 'goods'
}).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.getGoodsFavoritesList();
} else {
this.$u.toast(res.message);
}
})
},
@ -70,6 +87,7 @@ export default {
this.list.map((val, idx) => {
if(index != idx) this.list[idx].show = false;
})
this.$forceUpdate();
}
},
};

View File

@ -10,7 +10,7 @@
<view class="price"><span>{{ couponInfo.vouchertemplate_price }}</span></view>
<view class="condition">{{ couponInfo.vouchertemplate_limit }}使用</view>
</view>
<view class="info-store u-line-1">仅限{{ couponInfo.vouchertemplate_storename }}商品使用</view>
<view class="info-store u-line-1">仅限{{ couponInfo.type == 2 ? couponInfo.vouchertemplate_storename : '指定商品' }}使用</view>
<view class="info-integral">兑换积分{{ couponInfo.vouchertemplate_points }}积分</view>
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
</view>

View File

@ -10,7 +10,7 @@
<view class="price"><span>{{ couponInfo.voucher_price }}</span></view>
<view class="condition">{{ couponInfo.voucher_limit }}使用</view>
</view>
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '平台' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '指定商品' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
<view class="info-integral">兑换积分{{ couponInfo.voucher_points }}积分</view>
<view class="info-date">有效期{{ couponInfo.voucher_startdate }}-{{ couponInfo.voucher_enddate }}</view>
</view>

View File

@ -13,7 +13,7 @@
</swiper-item>
</swiper>
<!-- 加载更多 -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore" v-if="goodsList.length>=pageSize"></u-loadmore>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore"></u-loadmore>
</view>
</template>
<script>
@ -22,7 +22,7 @@ export default {
name:"list",
data() {
return {
pageSize: 12,
// pageSize: 12,
current: -1,
swiperCurrent: 0,
goodsList: [],

View File

@ -60,8 +60,9 @@ export default {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.recommendData.pintuan_id,
type: 2,
// id: this.recommendData.pintuan_id,
id: this.recommendData.groupbuy_id,
// type: 2,
}
})
}

View File

@ -45,8 +45,9 @@ export default {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.item.groupbuy_id,
type: 3,
// id: this.item.groupbuy_id,
id: this.item.goods_id,
// type: 3,
}
})
},

5
package-lock.json generated
View File

@ -4,6 +4,11 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"blueimp-md5": {
"version": "2.17.0",
"resolved": "https://registry.npm.taobao.org/blueimp-md5/download/blueimp-md5-2.17.0.tgz?cache=0&sync_timestamp=1595922448921&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fblueimp-md5%2Fdownload%2Fblueimp-md5-2.17.0.tgz",
"integrity": "sha1-9PysCIsRX3tARfGfXaWenQGxu5Y="
},
"uview-ui": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-1.5.0.tgz",

View File

@ -11,9 +11,10 @@
"url": "http://git.luyuan.tk/luyuan/deming.git"
},
"author": "",
"license": "ISC",
"license": "ISC",
"dependencies": {
"uview-ui": "^1.5.0",
"blueimp-md5": "^2.17.0",
"uview-ui": "^1.5.0",
"vuex": "^3.5.1"
}
}

View File

@ -27,10 +27,10 @@
<text>{{ goodsInfo.goods_price }}</text>
<s>{{ goodsInfo.goods_marketprice }}</s>
</view>
<view class="collect">
<u-icon name="star" color="#474747" size="28" v-if="1"></u-icon>
<view class="collect" @click="switchCollect(goodsInfo.goods_collect)">
<u-icon name="star" color="#474747" size="28" v-if="!goodsInfo.goods_collect"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
<text>收藏</text>
<text>{{ !goodsInfo.goods_collect ? '收藏' : '已收藏' }}</text>
</view>
</view>
</view>
@ -133,7 +133,7 @@
<guige @sel="self" ref="guige" v-for="(item,index) in goodsInfo.spec_value" :key="index" :title="goodsInfo.spec_name[index]" :item="item"></guige>
<view class="num">
<text>购买数量</text>
<u-number-box v-model="goodsNumber" @change="valChange"></u-number-box>
<u-number-box v-model="goodsNumber"></u-number-box>
</view>
<view style="height:100rpx"></view>
</view>
@ -146,7 +146,7 @@
<image src="/static/image/common/18.png"></image>
店铺
</view>
<view class="navs" style="margin-right:30rpx" v-if="!showSpec">
<view class="navs" style="margin-right:30rpx" v-if="!showSpec" @click="customers()">
<image src="/static/image/common/19.png"></image>
客服
</view>
@ -166,7 +166,7 @@
<image src="/static/image/common/18.png"></image>
<text>店铺</text>
</view>
<view>
<view @click="customers()">
<image src="/static/image/common/19.png"></image>
<text>客服</text>
</view>
@ -211,6 +211,7 @@ export default {
sel: "", //
quanxuan: false, //
debounce: true,
storeid:0 //id
}
},
components: {
@ -227,9 +228,11 @@ export default {
onLoad(option) {
// this.init();
// console.log(option);
this.type = Number(option.type);
// this.type = Number(option.type);
// this.type = 1;
this.id = option.id;
this.setTitle();
//
this.ordinaryDetails(this.id);
},
onShow() {
this.debounce = true;
@ -245,6 +248,34 @@ export default {
clearInterval(this.timer);
},
methods: {
customers(){
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = 0;
this.text = text;
this.time = time;
this.date = date
}
console.log(123)
this.$u.api.getAtwillUserInfo({
id:this.storeid
}).then((res)=>{
console.log(res)
let user = new Friend(res.data.member_id,res.data.member_nickname,res.data.member_avatar)
this.$u.route({
url:"/pageD/privateChat/privateChat",
params:{
id:JSON.stringify(user)
}
})
}).catch((err)=>{
console.log(err)
})
},
setSwiperList(list) {
let img = [];
list.forEach(item => {
@ -305,10 +336,6 @@ export default {
case 3:
this.spikeGoodsDetails(id);
break;
case 4:
break;
default:
break;
}
@ -316,13 +343,26 @@ export default {
//
ordinaryDetails(id) {
this.$u.api.getGoodsDetails({ id: id }).then((res)=>{
console.log(res)
if (res.errCode == 0) {
this.evaluate = res.data.goods_evaluate_info;
this.goodsInfo = res.data.goods;
this.storeInfo = res.data.store;
this.setSwiperList(res.data.goods_image);
this.glist = res.data.spec_list;
this.storeid = res.data.store.store_id
// console.log(this.goodsInfo.mobile_body);
this.type = res.data.view_type;
this.setTitle();
if(this.type == 1) {
this.id = res.data.goods.goods_id;
} else if(this.type == 2) {
this.id = res.data.goods.pintuan_id;
this.getGoodsDetails(this.id);
} else if(this.type == 3) {
this.id = res.data.goods.groupbuy_id;
this.getGoodsDetails(this.id);
}
}
})
},
@ -338,7 +378,7 @@ export default {
this.glist = res.data.data.spec_list;
this.user_suc = res.data.data.user_suc;
this.groupUser =res.data.data.user;
console.log(this.groupUser);
// console.log(this.groupUser);
}
})
},
@ -348,6 +388,7 @@ export default {
groupbuy_id: id
}).then(res => {
if(res.errCode == 0) {
this.id = res.data.groupbuy_id;
this.groupbuyInfo = res.data.groupbuyInfo;
this.evaluate = res.data.goodsInfo.goods_evaluate_info;
this.goodsInfo = res.data.goodsInfo.goods;
@ -361,7 +402,7 @@ export default {
this.$u.route({
url: '/pageB/triedDress/index',
params: {
id: this.id,
id: this.goodsInfo.goods_id,
}
})
},
@ -412,9 +453,6 @@ export default {
this.showInvolvementUser = true;
// console.log(this.involvemenGroupInfo);
},
valChange(e) {
// console.log(this.value)
},
self(){
// console.log(this.$refs.guige)
let index = 0;
@ -481,7 +519,32 @@ export default {
urls: arr,
current: arr[index]
})
}
},
switchCollect(status) {
if(status) {
this.removeFavorite();
} else {
this.addFavoriteGoods();
}
},
addFavoriteGoods() {
this.$u.api.addFavoriteGoods({ fid: this.goodsInfo.goods_id }).then(res => {
if(res.errCode == 0) {
this.getGoodsDetails(this.id);
} else {
this.$u.toast(res.message);
}
})
},
removeFavorite() {
this.$u.api.removeFavorite({ fid: this.goodsInfo.goods_id, type: 'goods' }).then(res => {
if(res.errCode == 0) {
this.getGoodsDetails(this.id);
} else {
this.$u.toast(res.message);
}
})
}
},
}
</script>

View File

@ -14,8 +14,8 @@
<view v-for="(goods, g_index) in store.goods" :key="g_index" class="goods-item">
<u-checkbox v-model="goods.checked" shape="circle" active-color="#FF780F" icon-size="35" :name="g_index"></u-checkbox>
<image :src="goods.goods_image" @click="viewGoodsDetails(goods.goods_id)"></image>
<view class="info" @click="viewGoodsDetails(goods.goods_id)">
<view class="name u-line-2">{{ goods.goods_name }}</view>
<view class="info">
<view class="name u-line-2" @click="viewGoodsDetails(goods.goods_id)">{{ goods.goods_name }}</view>
<view class="cart-info">
<view class="price">{{ goods.goods_price }}</view>
<u-number-box :input-width="38" :input-height="39" :size="22" bg-color="#FFFFFF" :disabled-input=true color="#FF780F" :index="goods.cart_id" @minus="reduce" @plus="plus" v-model="goods.goods_num"></u-number-box>
@ -238,7 +238,7 @@ export default {
// #ifdef APP-PLUS
let currentWebview = page.$getAppWebview();
let titleObj = currentWebview.getStyle().titleNView;
console.log(JSON.stringify(titleObj.buttons[0]));
// console.log(JSON.stringify(titleObj.buttons[0]));
if (!titleObj.buttons) {
return;
}

View File

@ -134,8 +134,8 @@
});
setTimeout(() => {
uni.setNavigationBarColor({
backgroundColor : '#D02129',
frontColor : '#ffffff'
backgroundColor : '#FF780F',
frontColor : '#333333'
});
}, 10);
@ -567,7 +567,7 @@
}
.chatInterface .message-item.self .content span{
color: #ffffff;
background:#D02129;
background:#FF780F;
word-break: break-all;
text-align: left;
max-width: 520rpx;

View File

@ -1,9 +1,11 @@
<template>
<view class="coupon-swiper">
<u-tabs-swiper ref="coupon" :list="couponGroupList" name="gc_name" :is-scroll="true" active-color="#FF780F" :current="couponCurrent" font-size="24" :show-bar="false" @change="couponTabsChange" height="88" ></u-tabs-swiper>
<swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
<scroll-view scroll-x="true" class="classify-coupon">
<view v-for="(classify, index) in couponGroupList" :key="index" class="classify-item" :class="{ 'active': couponCurrent == index }" @click="couponTabsChange(index)">{{ classify.gc_name }}</view>
</scroll-view>
<!-- <swiper :current="swiperCouponCurrent" @animationfinish="couponAnimationFinish" :style="{ height: swiperHeight }">
<swiper-item class="swiper-coupon-item" v-for="(_, i) in couponGroupList" :key="i">
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom">
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll">
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
<Coupon :couponInfo="coupon" :status='0' :type="0" @exchange="exchangeCoupon($event)"></Coupon>
</view>
@ -11,7 +13,14 @@
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
</scroll-view>
</swiper-item>
</swiper>
</swiper> -->
<scroll-view scroll-y style="height: 100%;" @scrolltolower="onreachBottom" class="coupon-scroll" :style="{ height: swiperHeight }">
<view v-for="(coupon, index) in couponList" :key="index" class="coupon-item">
<Coupon :couponInfo="coupon" :status='0' :type="0" @exchange="exchangeCoupon($event)"></Coupon>
</view>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" v-if="couponList.length>=pageSize" @loadmore="onreachBottom"></u-loadmore>
<u-empty text="暂无优惠券" mode="coupon" color="#000" v-if="!couponList.length"></u-empty>
</scroll-view>
</view>
</template>
<script>
@ -19,7 +28,7 @@ import Coupon from "@/components/mine/coupon/index";
export default {
data() {
return {
pageSize: 12,
pageSize: 5, //
swiperHeight: '',
couponCurrent: 0,
swiperCouponCurrent: 0,
@ -39,9 +48,10 @@ export default {
},
watch: {
couponCurrent(index) {
this.couponList = [];
const id = this.couponGroupList[index].gc_id;
this.getCouponList({ gc_id: id, load: 'reload' });
}
},
},
methods: {
onreachBottom() {
@ -89,6 +99,7 @@ export default {
},
couponTabsChange(index) {
this.couponCurrent = index;
this.swiperCouponCurrent = this.couponCurrent;
},
couponAnimationFinish(e) {
const current = e.detail.current;
@ -104,64 +115,92 @@ export default {
</script>
<style lang="scss" scoped>
.coupon-swiper {
.swiper-coupon-item {
box-sizing: border-box;
.classify-coupon {
white-space: nowrap;
width: 100%;
height: 88rpx;
background-color: #ffffff;
padding: 30rpx {
top: 0;
};
.coupon-item {
margin-bottom: 20rpx;
margin-bottom: 2rpx;
.classify-item {
display: inline-block;
line-height: 88rpx;
text-align: center;
font-size: 24rpx;
color: #333;
padding: 0 30rpx;
}
.active {
color: #FF780F;
font-weight: 700;
}
}
// .swiper-coupon-item {
// box-sizing: border-box;
// background-color: #ffffff;
// padding: 30rpx {
// top: 0;
// };
// .coupon-item {
// margin-bottom: 20rpx;
// }
// .coupon-item {
// padding: 30rpx;
// background-color: #ffffff;
// display: flex;
// align-items: flex-end;
// // margin-bottom: 2rpx;
// > img {
// width: 180rpx;
// height: 160rpx;
// border-radius: 10rpx;
// margin-right: 30rpx;
// }
// .coupon-main {
// .coupon-title {
// font-size: 30rpx;
// color: rgba(51,51,51,1);
// }
// .coupon-date {
// display: flex;
// align-items: center;
// margin: 29rpx 0 20rpx;
// > img {
// width: 24rpx;
// height: 24rpx;
// margin-right: 15rpx;
// }
// > view {
// font-size: 24rpx;
// color: rgba(153,153,153,1);
// }
// }
// .coupon-integral {
// font-size: 30rpx;
// font-weight: 500;
// color: rgba(255,120,15,1);
// }
// }
// .coupon-btn {
// margin-left: auto;
// width: 85rpx;
// // height: 42rpx;
// border: 2rpx solid rgba(255,120,15,1);
// border-radius: 10rpx;
// font-size: 26rpx;
// color: rgba(255,120,15,1);
// line-height: 42rpx;
// text-align: center;
// }
// }
// }
.coupon-scroll {
background-color: #ffffff;
padding-top: 30rpx;
.coupon-item {
padding: 30rpx {
top: 0;
};
}
// .coupon-item {
// padding: 30rpx;
// background-color: #ffffff;
// display: flex;
// align-items: flex-end;
// // margin-bottom: 2rpx;
// > img {
// width: 180rpx;
// height: 160rpx;
// border-radius: 10rpx;
// margin-right: 30rpx;
// }
// .coupon-main {
// .coupon-title {
// font-size: 30rpx;
// color: rgba(51,51,51,1);
// }
// .coupon-date {
// display: flex;
// align-items: center;
// margin: 29rpx 0 20rpx;
// > img {
// width: 24rpx;
// height: 24rpx;
// margin-right: 15rpx;
// }
// > view {
// font-size: 24rpx;
// color: rgba(153,153,153,1);
// }
// }
// .coupon-integral {
// font-size: 30rpx;
// font-weight: 500;
// color: rgba(255,120,15,1);
// }
// }
// .coupon-btn {
// margin-left: auto;
// width: 85rpx;
// // height: 42rpx;
// border: 2rpx solid rgba(255,120,15,1);
// border-radius: 10rpx;
// font-size: 26rpx;
// color: rgba(255,120,15,1);
// line-height: 42rpx;
// text-align: center;
// }
// }
}
}
</style>

View File

@ -51,7 +51,6 @@ export default {
})
},
removeFavorite(id) {
console.log(id);
this.$u.api.removeFavorite({
id: id,
type: 'store'

View File

@ -5,7 +5,7 @@
</view>
<swiper :current="swiperCurrent" @animationfinish="animationfinish" :style="{ height: swiperHeight }">
<swiper-item class="swiper-item" v-for="(item, index) in list" :key="index">
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom">
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom" class="order-scroll">
<view>
<view class="item-container" v-for="order in orderList" :key="order.order_id">
<OrderItem :order="order" @refreshOrderList="refreshOrderList" v-if="current != 4"></OrderItem>
@ -13,7 +13,7 @@
</view>
</view>
<u-empty text="暂无订单" mode="order" color="#000000" v-if="!orderList.length"></u-empty>
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="orderList.length >= 15"></u-loadmore>
<u-loadmore :status="loadStatus[index]" bgColor="#ECECEC" margin-bottom="20" v-if="current != 4 && orderList.length>3" class="order-loadmore"></u-loadmore>
</scroll-view>
</swiper-item>
</swiper>
@ -162,8 +162,7 @@ export default {
return res.data.list.length;
},
reachBottom() {
// 15
if(this.orderList.length < 15) return false;
if(this.current == 4) return;
if(!this.timer) return false;
this.timer = false;
this.loadStatus.splice(this.current, 1, "loading");
@ -171,8 +170,8 @@ export default {
let promise;
// if(this.current == 6) promise = this.getAfterSaleList();
// else
if(this.current == 4) promise = this.goodsTryOrderList();
else promise = this.getOrderList();
// if(this.current == 4) promise = this.goodsTryOrderList();
promise = this.getOrderList();
promise.then(length => {
this.loadStatus.splice(this.current, 1, "nomore");
if(length == 0) this.page--;
@ -204,8 +203,10 @@ export default {
display: flex;
flex-direction: column;
.swiper-item {
.item-container {
padding: 20rpx 30rpx;
.order-scroll {
.item-container {
padding: 20rpx 30rpx;
}
}
}
}

View File

@ -1030,7 +1030,6 @@
{
"path": "pages/mine/index",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "我的",
"app-plus": {
"titleSize": "36px",

View File

@ -251,6 +251,23 @@
this.getArticlelist();
this.getSwiper();
},
onLoad(){
if(this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info');
console.log(user)
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
this.imService.connectIM()
let that = this
setTimeout(function(){
that.imService.disconnect()
console.log("guanbi")
},1000)
setTimeout(function(){
console.log("lianjie")
that.imService.connectIM()
},2000)
}
},
onPullDownRefresh() {
this.getArticlelist();
// this.getManicureList({ load: 'reload' });
@ -428,4 +445,4 @@
}
},
}
</script>
</script>

View File

@ -23,6 +23,8 @@
<view class="title">{{item.name}}</view>
<view class="contentes u-line-1">{{item.text}}</view>
<view class="times">{{item.time}}</view>
<view class="tishi" v-if="item.unReadMessage"></view>
</view>
</view>
</view>
@ -100,21 +102,7 @@
if (this.hasLogin) {
this.messageIndex();
}
if(this.$store.state.hasLogin){
const user = uni.getStorageSync('user_info');
console.log(user)
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
this.imService.connectIM()
let that = this
setTimeout(function(){
that.imService.disconnect()
console.log("guanbi")
},1000)
setTimeout(function(){
console.log("lianjie")
that.imService.connectIM()
},2000)
}
},
methods: {
gochat(id){
@ -173,10 +161,14 @@
},
//
delMessage(){
this.$u.api.delMessage({
type : "all"
}).then((res)=>{
console.log(res)
this.imService.friends = {};
this.information_dl = [];
uni.setStorageSync('imlist',JSON.stringify([]));
if(res.errCode == 0){
this.$refs.uToast.show({
title: '清除成功',
@ -194,6 +186,15 @@
</script>
<style lang="scss" scoped>
.tishi{
position: absolute;
bottom: 30rpx;
right: 30rpx;
width: 12rpx;
height: 12rpx;
border-radius: 50%;
background-color: #FF0000;
}
.sousuo {
height: 113rpx;
border: 1px #f00 solid;
@ -236,6 +237,7 @@
padding-bottom: 23rpx;
border-bottom: 1px #ececec solid;
padding: 20rpx 5rpx 23rpx 5rpx;
position: relative;
image {
width: 84rpx;

View File

@ -19,10 +19,10 @@
<view class="member-service" @click="toOtherPage('/mine/MemberServe')">会员服务</view>
</view>
<view class="bottom">
<!-- <view @click="toOtherPage('/mine/GoodsCollection')">
<view @click="toOtherPage('/mine/GoodsCollection')">
<view>{{ userInfo.member_fav_goods_num || 0 }}</view>
<view>商品收藏</view>
</view> -->
</view>
<!-- <view @click="toOtherPage('/mine/StoreCollection')">
<view>{{ userInfo.member_fav_store_num || 0 }}</view>
<view>店铺收藏</view>
@ -158,7 +158,7 @@ export default {
methods: {
getUserInfo() {
this.$u.api.getMemberInfo().then(res => {
uni.stopPullDownRefresh();
// uni.stopPullDownRefresh();
if (res.errCode == 0) {
// this.userInfo = res.data.MemberArray;
this.$set(this, 'userInfo', res.data.MemberArray);
@ -329,6 +329,12 @@ export default {
}
.content {
justify-content: space-between;
> view {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
}
> view:nth-child(1){
@include image-size($image-width: 33rpx, $image-height: 36rpx);
}

View File

@ -8,12 +8,12 @@
import GoEasyIM from './goeasy-im-1.0.9';
import restApi from './restapi';
function Friend(uuid, name, avatar,time = "", text = "",date = "") {
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
this.uuid = uuid;
this.name = name;
this.avatar = avatar;
this.online = false;
this.unReadMessage = 0;
this.unReadMessage = parseInt(unReadMessage);
this.text = text;
this.time = time;
this.date = date
@ -106,7 +106,7 @@ IMService.prototype.initialContacts = function (friendList) {
},
success(res){
console.log(res)
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2]);
that.friends[i[0]] = new Friend(res.data.data.member_id, res.data.data.member_nickname, res.data.data.member_avatar,i[1],i[2],i[3]);
console.log(that.friends)
let sorts = function (friends){
let paixu = function (a,b){
@ -299,7 +299,7 @@ IMService.prototype.initialIMListeners = function () {
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date])
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))
@ -323,7 +323,7 @@ IMService.prototype.initialIMListeners = function () {
sorts(that.friendsarr)
let arr = []
for(let i in that.friends){
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date])
arr.push([that.friends[i].uuid,that.friends[i].time,that.friends[i].text,that.friends[i].date,that.friends[i].unReadMessage])
}
console.log(arr)
uni.setStorageSync('imlist',JSON.stringify(arr))

2
static/js/md5.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
!function(n){"use strict";function d(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function f(n,t,r,e,o,u){return d((c=d(d(t,n),d(e,u)))<<(f=o)|c>>>32-f,r);var c,f}function l(n,t,r,e,o,u,c){return f(t&r|~t&e,n,t,o,u,c)}function v(n,t,r,e,o,u,c){return f(t&e|r&~e,n,t,o,u,c)}function g(n,t,r,e,o,u,c){return f(t^r^e,n,t,o,u,c)}function m(n,t,r,e,o,u,c){return f(r^(t|~e),n,t,o,u,c)}function i(n,t){var r,e,o,u;n[t>>5]|=128<<t%32,n[14+(t+64>>>9<<4)]=t;for(var c=1732584193,f=-271733879,i=-1732584194,a=271733878,h=0;h<n.length;h+=16)c=l(r=c,e=f,o=i,u=a,n[h],7,-680876936),a=l(a,c,f,i,n[h+1],12,-389564586),i=l(i,a,c,f,n[h+2],17,606105819),f=l(f,i,a,c,n[h+3],22,-1044525330),c=l(c,f,i,a,n[h+4],7,-176418897),a=l(a,c,f,i,n[h+5],12,1200080426),i=l(i,a,c,f,n[h+6],17,-1473231341),f=l(f,i,a,c,n[h+7],22,-45705983),c=l(c,f,i,a,n[h+8],7,1770035416),a=l(a,c,f,i,n[h+9],12,-1958414417),i=l(i,a,c,f,n[h+10],17,-42063),f=l(f,i,a,c,n[h+11],22,-1990404162),c=l(c,f,i,a,n[h+12],7,1804603682),a=l(a,c,f,i,n[h+13],12,-40341101),i=l(i,a,c,f,n[h+14],17,-1502002290),c=v(c,f=l(f,i,a,c,n[h+15],22,1236535329),i,a,n[h+1],5,-165796510),a=v(a,c,f,i,n[h+6],9,-1069501632),i=v(i,a,c,f,n[h+11],14,643717713),f=v(f,i,a,c,n[h],20,-373897302),c=v(c,f,i,a,n[h+5],5,-701558691),a=v(a,c,f,i,n[h+10],9,38016083),i=v(i,a,c,f,n[h+15],14,-660478335),f=v(f,i,a,c,n[h+4],20,-405537848),c=v(c,f,i,a,n[h+9],5,568446438),a=v(a,c,f,i,n[h+14],9,-1019803690),i=v(i,a,c,f,n[h+3],14,-187363961),f=v(f,i,a,c,n[h+8],20,1163531501),c=v(c,f,i,a,n[h+13],5,-1444681467),a=v(a,c,f,i,n[h+2],9,-51403784),i=v(i,a,c,f,n[h+7],14,1735328473),c=g(c,f=v(f,i,a,c,n[h+12],20,-1926607734),i,a,n[h+5],4,-378558),a=g(a,c,f,i,n[h+8],11,-2022574463),i=g(i,a,c,f,n[h+11],16,1839030562),f=g(f,i,a,c,n[h+14],23,-35309556),c=g(c,f,i,a,n[h+1],4,-1530992060),a=g(a,c,f,i,n[h+4],11,1272893353),i=g(i,a,c,f,n[h+7],16,-155497632),f=g(f,i,a,c,n[h+10],23,-1094730640),c=g(c,f,i,a,n[h+13],4,681279174),a=g(a,c,f,i,n[h],11,-358537222),i=g(i,a,c,f,n[h+3],16,-722521979),f=g(f,i,a,c,n[h+6],23,76029189),c=g(c,f,i,a,n[h+9],4,-640364487),a=g(a,c,f,i,n[h+12],11,-421815835),i=g(i,a,c,f,n[h+15],16,530742520),c=m(c,f=g(f,i,a,c,n[h+2],23,-995338651),i,a,n[h],6,-198630844),a=m(a,c,f,i,n[h+7],10,1126891415),i=m(i,a,c,f,n[h+14],15,-1416354905),f=m(f,i,a,c,n[h+5],21,-57434055),c=m(c,f,i,a,n[h+12],6,1700485571),a=m(a,c,f,i,n[h+3],10,-1894986606),i=m(i,a,c,f,n[h+10],15,-1051523),f=m(f,i,a,c,n[h+1],21,-2054922799),c=m(c,f,i,a,n[h+8],6,1873313359),a=m(a,c,f,i,n[h+15],10,-30611744),i=m(i,a,c,f,n[h+6],15,-1560198380),f=m(f,i,a,c,n[h+13],21,1309151649),c=m(c,f,i,a,n[h+4],6,-145523070),a=m(a,c,f,i,n[h+11],10,-1120210379),i=m(i,a,c,f,n[h+2],15,718787259),f=m(f,i,a,c,n[h+9],21,-343485551),c=d(c,r),f=d(f,e),i=d(i,o),a=d(a,u);return[c,f,i,a]}function a(n){for(var t="",r=32*n.length,e=0;e<r;e+=8)t+=String.fromCharCode(n[e>>5]>>>e%32&255);return t}function h(n){var t=[];for(t[(n.length>>2)-1]=void 0,e=0;e<t.length;e+=1)t[e]=0;for(var r=8*n.length,e=0;e<r;e+=8)t[e>>5]|=(255&n.charCodeAt(e/8))<<e%32;return t}function e(n){for(var t,r="0123456789abcdef",e="",o=0;o<n.length;o+=1)t=n.charCodeAt(o),e+=r.charAt(t>>>4&15)+r.charAt(15&t);return e}function r(n){return unescape(encodeURIComponent(n))}function o(n){return a(i(h(t=r(n)),8*t.length));var t}function u(n,t){return function(n,t){var r,e,o=h(n),u=[],c=[];for(u[15]=c[15]=void 0,16<o.length&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}(r(n),r(t))}function t(n,t,r){return t?r?u(t,n):e(u(t,n)):r?o(n):e(o(n))}"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.md5=t}(this);
//# sourceMappingURL=md5.min.js.map