This commit is contained in:
Gdpao 2020-08-31 09:10:40 +08:00
commit ee3ba5b0dc
21 changed files with 244 additions and 20 deletions

View File

@ -86,11 +86,12 @@ export default {
return vm.$u.post('Goods/getGoodsClassRecommend');
},
// goodsListByClassId
goodsListByClassId({ gc_id, page, order }) {
goodsListByClassId({ gc_id, page, order, keyword }) {
return vm.$u.post('goods/goodsListByClassId', {
gc_id: gc_id,
page: page,
order: order,
keyword:keyword
});
},
// 商品推荐

View File

@ -454,6 +454,19 @@ export default {
//获取默认头像
getDefaultAvatar(){
return vm.$u.post("member/getDefaultAvatar")
},
// 第三方账号绑定【微信|QQ】
bindingThird({ openid, type }) {
return vm.$u.post("auth/memberBindThird", {
third_openid: openid,
third_type: type,
})
},
// 解绑
unbindingThird({ type }) {
return vm.$u.post("auth/memberUnbindThird", {
third_type: type,
})
}
}

View File

@ -1,6 +1,6 @@
<template>
<view class="c-coupon" v-if="goodsClass.length">
<view :class="couponInfo.voucher_state != 1 ? 'coupon-unable' : 'coupon-usable'">
<view class="c-coupon" v-if="goodsClass.length" @click="use">
<view :class="couponInfo.voucher_state != 1 ? 'coupon-unable' : 'coupon-usable'" :style="{'width': type ? '650rpx' : '' }">
<view class="info-type" :style="{ backgroundImage: 'url(' + (couponInfo.voucher_state == 1 ? '/static/image/mine/30.png' : '/static/image/mine/31.png') + ')', backgroundSize:'contain', backgroundRepeat: 'no-repeat' }">
<div class="wrap_left_top" v-if="couponInfo.type == 1">{{ couponInfo.vouchertemplate_id == 1 ? '新人专享' : '平台优惠券' }}</div>
<div class="wrap_left_top" v-else-if="couponInfo.type == 2">店铺优惠券</div>
@ -14,12 +14,13 @@
<view class="info-integral">兑换积分{{ couponInfo.voucher_points }}积分</view>
<view class="info-date">有效期{{ couponInfo.voucher_startdate }}-{{ couponInfo.voucher_enddate }}</view>
</view>
<view class="coupon-btn">
<text v-if="couponInfo.voucher_state == 1" @click="use">立即使用</text>
<view class="coupon-btn" :style="{'right': type ? '110rpx' : '' }">
<text v-if="couponInfo.voucher_state == 1">立即使用</text>
<image v-if="couponInfo.voucher_state == 2" src="/static/image/mine/28.png"></image>
<image v-if="couponInfo.voucher_state == 3" src="/static/image/mine/29.png"></image>
</view>
</view>
<image v-if="type" style="width:35rpx;height:35rpx;margin-left:14rpx;" :src="'/static/image/mine/' + (sel ? '41.png' : '42.png') "></image>
</view>
</template>
<script>
@ -37,6 +38,8 @@ export default {
status: Number,
couponInfo: Object,
goodsClass: Array,
type:Boolean,
sel:Boolean
},
created() {
// console.log(this.goodsClass);
@ -53,6 +56,7 @@ export default {
},
methods: {
use() {
if(this.couponInfo.voucher_state != 1) return;
this.$emit('use', this.couponInfo);
},
},
@ -63,6 +67,8 @@ export default {
position: relative;
z-index: 9;
margin-bottom: 30rpx;
display: flex;
align-items: center;
@mixin coupon-image($url) {
width: 690rpx;
height: 194rpx;

View File

@ -22,7 +22,7 @@
<view class="swiper-item uni-bg-red">
<image :src=" 'https://' + item.launch_path"></image>
</view>
<view class="btn-init" v-if="parseInt(index) == list.length - 1" @click="goNext">立即体验</view>
<view class="btn-init" v-if="parseInt(index) == list.length - 1" @click="goNext">立即体验</view>
</swiper-item>
</swiper>
</view>

View File

@ -70,13 +70,13 @@
<scroll-view class="coupon-choose" scroll-y style="height: 50vh;" v-if="this.couponType.type == 1">
<view class="title">优惠券详情</view>
<view class="text">平台优惠券</view>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_all_list" :key="index"></Coupon>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_all_list" :key="index" :type="true" :sel="coupon.sel"></Coupon>
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_all_list.length" style="height: 200rpx"></u-empty>
</scroll-view>
<scroll-view class="coupon-choose" scroll-y style="height: 50vh;" v-if="this.couponType.type == 2">
<view class="title">优惠券详情</view>
<view class="text">店铺优惠券</view>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_list[this.couponType.store_id]" :key="index"></Coupon>
<Coupon :couponInfo="coupon" @use="useCoupon($event)" :goodsClass="goodsClass" v-for="(coupon, index) in orderInfo.store_voucher_list[this.couponType.store_id]" :key="index" :type="true" :sel="coupon.sel"></Coupon>
<u-empty text="无可用优惠券" mode="coupon" v-if="!orderInfo.store_voucher_list[this.couponType.store_id].length" style="height: 200rpx"></u-empty>
</scroll-view>
</u-popup>
@ -282,15 +282,42 @@ export default {
this.couponStatus = true;
},
useCoupon(coupon) {
if(this.couponType.type == 1) this.choiceCoupon = coupon;
console.log(coupon)
if(this.couponType.type == 1){
this.choiceCoupon = {}
for(let i in this.orderInfo.store_voucher_all_list){
if(this.orderInfo.store_voucher_all_list[i].voucher_id == coupon.voucher_id && !this.orderInfo.store_voucher_all_list[i].sel){
this.orderInfo.store_voucher_all_list[i].sel = true
this.choiceCoupon = coupon;
}else{
this.orderInfo.store_voucher_all_list[i].sel = false
}
}
this.$forceUpdate()
}
if(this.couponType.type == 2) {
Object.assign(this.storeCoupon, {
[this.couponType.store_id]: coupon
})
this.storeCoupon = {}
for(let i in this.orderInfo.store_voucher_list[this.couponType.store_id]){
console.log(this.orderInfo.store_voucher_list[this.couponType.store_id][i])
if(this.orderInfo.store_voucher_list[this.couponType.store_id][i].voucher_id == coupon.voucher_id && !this.orderInfo.store_voucher_list[this.couponType.store_id][i].sel){
this.orderInfo.store_voucher_list[this.couponType.store_id][i].sel = true
Object.assign(this.storeCoupon, {
[this.couponType.store_id]: coupon
})
}else{
this.orderInfo.store_voucher_list[this.couponType.store_id][i].sel = false
}
}
this.$forceUpdate()
}
// console.log(this.choiceCoupon);
// console.log(this.storeCoupon);
this.couponStatus = false;
// this.couponStatus = false;
this.setTotalPrice(); //
},
getFreight() {

View File

@ -1,5 +1,6 @@
<template>
<view class="classify-goods">
<u-search style="padding: 0 30rpx" placeholder="日照香炉生紫烟" v-model="keyword" @search="select" @custom="select"></u-search>
<view class="tab-container">
<view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">销量</view>
<view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">
@ -42,6 +43,8 @@ export default {
scrollHeight: '',
loadStatus: 'loadmore',
timer: true, //
keyword:"",
sel:""
}
},
watch: {
@ -80,6 +83,7 @@ export default {
gc_id: this.cid,
page: this.page,
order: sort,
keyword:this.sel
})
this.timer = true;
if(res.errCode == 0) {
@ -123,6 +127,11 @@ export default {
id: id,
type: 1 // 1 2 3 4
});
},
select(){
this.sel = this.keyword;
this.page = 1;
this.goodsListByClassId({ laod: 'reload' });
}
}
};

View File

@ -43,7 +43,7 @@
};
</script>
<style lang="scss" scoped>
<style lang="scss">
page {
background-color: #ECECEC;
}

View File

@ -128,6 +128,8 @@
this.friend = JSON.parse(options.id);
this.currentUser = this.imService.currentUser;
let privateMessages = this.imService.getPrivateMessages(this.friend.uuid);
this.imService.uid = this.friend.uuid;
this.messages = privateMessages.sentMessages;
this.pendingMessages = privateMessages.pendingMessages;
@ -153,6 +155,7 @@
this.imService.onPrivateHistoryLoad = (friendId, messages) =>{};
//
this.imService.resetFriendUnReadMessage(this.friend);
this.imService.uid = 0;
},
methods: {
bindtapInput(){

View File

@ -62,13 +62,16 @@
title: '证件中心',
link: '../mine/ArticleDetails?type=1'
},
{
title: '第三方绑定',
link: './binding'
},
{
title: '屏蔽用户',
link: './ShieldUsers'
},
{
title: '关于我们',
// link: '../mine/ArticleDetails?type=2'
link: '/pageE/setting/version'
},
{

129
pageE/setting/binding.vue Normal file
View File

@ -0,0 +1,129 @@
<template>
<view class="binding">
<view class="binding-item" v-for="(item, index) in bangdingList" :key="index">
<view class="title">{{ item.title }}</view>
<view class="btn unbundling-btn" @click="unbinding(item.type)" v-if="userInfo[item.name]">
<image src="/static/image/mine/44.png"></image>
<text>解绑</text>
</view>
<view class="btn bundling-btn" @click="binding(item.provider, item.type)" v-else>
<image src="/static/image/mine/43.png"></image>
<text>绑定</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: '',
bangdingList: [
{
title: 'QQ',
provider: 'qq', // uni provider
type: 'qq', // type
name: 'member_qqopenid', //
},
{
title: '微信',
provider: 'weixin',
type: 'wechat',
name: 'member_wxopenid',
}
]
}
},
onLoad() {
this.getMemberInfo();
},
methods: {
getMemberInfo() {
this.$u.api.getMemberInfo().then(res => {
if (res.errCode == 0) {
this.userInfo = res.data.MemberArray;
}
})
},
binding(provider, type) {
uni.login({
provider: provider,
success: (loginRes) => {
console.log(loginRes);
uni.getUserInfo({
provider: provider,
success: (res) => {
console.log(res.userInfo.openId);
this.$u.api.bindingThird({
openid: res.userInfo.openId,
type: type
}).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.getMemberInfo();
}
})
}
})
},
fail: (e) => {
console.log(e);
}
});
},
unbinding(type) {
this.$u.api.unbindingThird({ type: type }).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.getMemberInfo();
}
})
}
}
};
</script>
<style lang="scss" scoped>
.binding {
min-height: calc(100vh - var(--window-top));
background-color: #ECECEC;
padding-top: 1rpx;
.binding-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 35rpx 30rpx;
height: 98rpx;
background-color: #FFFFFF;
&:not(:last-child) {
margin-bottom: 2rpx;
}
.title {
font-size: 30rpx;
color: rgba(52,52,52,1);
}
.btn {
// width: 112rpx;
height: 48rpx;
border-radius: 10rpx;
font-size: 24rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 12rpx 16rpx;
> image {
width: 26rpx;
height: 26rpx;
margin-right: 10rpx;
}
}
.unbundling-btn {
border: 1rpx solid rgba(102,102,102,1);
color: rgba(102,102,102,1);
}
.bundling-btn {
border: 1rpx solid rgba(255,120,16,1);
color: #FF7810;
}
}
}
</style>

View File

@ -49,7 +49,7 @@
const pages = getCurrentPages();
// console.log(pages);
if(pages.length == 2) {
this.$u.route('/pageA/login/login');
this.$u.route('/pageA/welcome/welcome');
} else {
uni.navigateBack();
}

View File

@ -988,6 +988,19 @@
}
}
},
{
"path": "setting/binding",
"style": {
"navigationBarTitleText": "第三方绑定",
"app-plus": {
"titleSize": "36px",
"titleNView": {
"titleColor": "#333333",
"backgroundColor": "#FFFFFF"
}
}
}
},
{
"path": "setting/ShieldUsers",
"style": {

View File

@ -262,7 +262,8 @@
loading: '努力加载中',
nomore: '实在没有了'
},
refresher:true
refresher:true,
zqie:false
}
},
components: {
@ -354,7 +355,11 @@
tabLiveList() {
uni.showLoading({
title: "loading..."
})
})
if(this.zqie){
return ;
}
this.zqie = true;
this.$u.api.tabLiveList({page:this.live_page}).then((res) => {
// uni.stopPullDownRefresh();
this.status_live = "loading";
@ -371,6 +376,7 @@
} else if (res.data.data.length == 0 && this.live_page > 1) {
this.status_live = "nomore";
} else {
console.log(this.live_page,1223)
this.tabLiveLists = this.tabLiveLists.concat(res.data.data);
console.log(this.tabLiveLists)
}
@ -381,6 +387,8 @@
} else {
this.status_live = "nomore"
}
this.zqie = false;
})
},

View File

@ -18,7 +18,7 @@
<view class="hot" :style="{'top': top + 10 * rpx}">
<text class="hottext">{{room.onlineUsers.users.length}}</text>
</view>
<image class="cart" src="../../static/cart.png" @click="show = true">
<image v-if="list.length != 0" class="cart" src="../../static/cart.png" @click="show = true">
</image>
<view class="danmufasongbox" @click="danmu = $store.state.hasLogin">
@ -29,7 +29,7 @@
<!-- <image class="liketap" src="../../static/like.png" @click=""> -->
<view class="danmuinputbox" v-if="danmu">
<input type="text" focus="true" style="width:600rpx;margin-left:30rpx;font-size:26rpx" maxlength="20" @blur="danmu=false" :focus="danmu" v-model="danmutext">
<input type="text" focus="true" style="width:600rpx;margin-left:30rpx;font-size:26rpx" maxlength="100" @blur="danmu=false" :focus="danmu" v-model="danmutext">
<view class="danmufasong" @click="sendMessage(room.MessageType.CHAT,danmutext)">
<text style="font-size:24rpx;color:#fff">发送</text>
</view>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 B

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
static/image/mine/41.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/image/mine/42.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
static/image/mine/43.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 B

BIN
static/image/mine/44.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -8,6 +8,8 @@
import GoEasyIM from './goeasy-im-1.0.9';
// import GoEasyIM from './goeasy-im-1.1.1';
import restApi from './restapi';
import music from './music.mp3'
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
this.uuid = uuid;
@ -52,6 +54,8 @@ function IMService() {
//群聊消息记录map格式每个群对应一个数组
this.groupMessages = {};
this.uid = 0;
/*
* 监听器们
@ -283,6 +287,14 @@ IMService.prototype.initialIMListeners = function () {
friends.sort(paixu)
}
if(message.senderId != this.uid){
const innerAudioContext = uni.createInnerAudioContext();
innerAudioContext.autoplay = true;
innerAudioContext.src = music;
innerAudioContext.onPlay(() => {
console.log('开始播放');
});
}
let that = this
if(!friend && friend == undefined){

BIN
static/music.mp3 Normal file

Binary file not shown.