first commit
This commit is contained in:
185
pages/user/address/add/add.vue
Normal file
185
pages/user/address/add/add.vue
Normal file
@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<view class="address-form" :data-theme='theme()' :class="theme() || ''">
|
||||
<form @submit="formSubmit" @reset="formReset">
|
||||
<view class="bg-white p-0-30 f30">
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">收货人</text>
|
||||
<input class="ml20 flex-1 f32 p-30-0" name="name" type="text" placeholder-class="grary9" v-model="address.name"
|
||||
placeholder="请输入收货人姓名" />
|
||||
</view>
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">联系方式</text>
|
||||
<input class="ml20 flex-1 f32 p-30-0" name="phone" type="text" placeholder-class="grary9" v-model="address.phone"
|
||||
placeholder="请输入收货人手机号" />
|
||||
</view>
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">所在地区</text>
|
||||
<view class="input-box flex-1">
|
||||
<input class="ml20 f32 flex-1 p-30-0" type="text" value="" placeholder-class="grary9" placeholder="" v-model="selectCity"
|
||||
disabled="true" @click="showMulLinkageThreePicker" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">详细地址</text>
|
||||
<textarea class="ml20 flex-1 p-30-0 lh150" name="detail" :auto-height="true" v-model="address.detail"
|
||||
placeholder-class="grary9" placeholder="请输入街道小区楼牌号等"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p30"><button form-type="submit" class="theme-btn f32 mt60 addBtn">保存</button></view>
|
||||
</form>
|
||||
<mpvue-city-picker v-if="is_load" ref="mpvueCityPicker" :province="province" :city="city" :area="area" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm"></mpvue-city-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue';
|
||||
export default {
|
||||
components: {
|
||||
mpvueCityPicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cityPickerValueDefault: [0, 0, 0],
|
||||
selectCity: '选择省,市,区',
|
||||
province_id: 0,
|
||||
city_id: 0,
|
||||
region_id: 0,
|
||||
address: {},
|
||||
delta: 1,
|
||||
province: [],
|
||||
city: [],
|
||||
area: [],
|
||||
is_load: false
|
||||
};
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.delta = options.delta;
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 获取省市区
|
||||
getData(){
|
||||
let self = this;
|
||||
self._post('settings/getRegion', {}, function(res) {
|
||||
self.province = res.data.regionData[0];
|
||||
self.city = res.data.regionData[1];
|
||||
self.area = res.data.regionData[2];
|
||||
self.is_load = true;
|
||||
});
|
||||
},
|
||||
/*提交*/
|
||||
formSubmit: function(e) {
|
||||
let self = this;
|
||||
var formdata = e.detail.value;
|
||||
formdata.province_id = self.province_id;
|
||||
formdata.city_id = self.city_id;
|
||||
formdata.region_id = self.region_id;
|
||||
if (formdata.name == '') {
|
||||
uni.showToast({
|
||||
title: '请输入收货人姓名',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (formdata.phone == '') {
|
||||
uni.showToast({
|
||||
title: '请输入手机号码',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
/*let reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
|
||||
if (!reg.test(formdata.phone)) {
|
||||
uni.showToast({
|
||||
title: '手机号码格式不正确',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}*/
|
||||
|
||||
if (formdata.province_id == 0 || formdata.city_id == 0 || formdata.region_id) {
|
||||
if (formdata.detail == '') {
|
||||
uni.showToast({
|
||||
title: '请选择完整省市区',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (formdata.detail == '') {
|
||||
uni.showToast({
|
||||
title: '请输入街道小区楼牌号等',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
self._post('user.address/add', formdata, function(res) {
|
||||
self.showSuccess(res.msg, function() {
|
||||
// #ifndef H5
|
||||
uni.navigateBack({
|
||||
delta: parseInt(self.delta)
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
history.go(-self.delta);
|
||||
// #endif
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
formReset: function(e) {
|
||||
console.log('清空数据');
|
||||
},
|
||||
|
||||
/*三级联动选择*/
|
||||
showMulLinkageThreePicker() {
|
||||
this.$refs.mpvueCityPicker.show();
|
||||
},
|
||||
|
||||
/*确定选择的省市区*/
|
||||
onConfirm(e) {
|
||||
this.selectCity = e.label;
|
||||
this.province_id = e.cityCode[0];
|
||||
this.city_id = e.cityCode[1];
|
||||
this.region_id = e.cityCode[2];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.address-form {
|
||||
/* border-top: 16rpx solid #f2f2f2; */
|
||||
}
|
||||
|
||||
.address-form .key-name {
|
||||
width: 140rpx;
|
||||
font-size: 32rpx
|
||||
}
|
||||
|
||||
.address-form .btn-red {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
box-shadow: 0 8rpx 16rpx 0 rgba(226, 35, 26, .6);
|
||||
}
|
||||
|
||||
.addBtn {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
</style>
|
||||
241
pages/user/address/address.vue
Normal file
241
pages/user/address/address.vue
Normal file
@ -0,0 +1,241 @@
|
||||
<template>
|
||||
<view v-if="!loadding" :data-theme='theme()' :class="theme() || ''">
|
||||
<view v-if="listData.length>0" class="pbenv">
|
||||
<view class="address-list bg-white">
|
||||
<view class="address p-30-0 border-b-d" v-for="(item,index) in listData" :key="index">
|
||||
<view class="info flex-1 mb10">
|
||||
<view class="user f32 d-b-c">
|
||||
<text>{{item.name}}</text>
|
||||
<text class="ml20 gray9 f26">{{item.phone}}</text>
|
||||
</view>
|
||||
<view class="pt20 f26 gray3">
|
||||
{{item.region.province}}{{item.region.city}}{{item.region.region}}{{item.detail}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-b-c">
|
||||
<view class="radio d-s-c">
|
||||
<radio style="transform:scale(0.6)" :color='getThemeColor()' :value="item.address_id+''" :checked="default_id==item.address_id+''"
|
||||
@click="radioChange(item.address_id)" />
|
||||
<text class="">默认地址</text>
|
||||
</view>
|
||||
<view class="d-s-c">
|
||||
<view class="icon-box plus d-c-c ml30" @click="delAddress(item.address_id)">
|
||||
<image class="add_icon_img" src="/static/icon/delete.png" mode="aspectFill"></image>
|
||||
<text class="gray9 ml10">删除</text>
|
||||
</view>
|
||||
<view class="none_line ml30"></view>
|
||||
<view class="icon-box plus d-c-c ml30 mr40" @click="editAddress(item.address_id)">
|
||||
<image class="add_icon_img" src="/static/icon/edit.png" mode="aspectFill"></image>
|
||||
<text class="gray9 ml10">编辑</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="add_add-btn theme-btn" @click="addAddress()">新增收货地址</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="none_add">
|
||||
<image class="no_add" src="/static/no_adress.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="no_add_add" @click="addAddress()">新增收货地址</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
/*是否加载完成*/
|
||||
loadding: true,
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
/*数据*/
|
||||
listData: [],
|
||||
/*默认地址id*/
|
||||
default_id: '0',
|
||||
options: {}
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
this.options = options;
|
||||
},
|
||||
onShow: function() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
/*获取地址列表*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
let dataType = self.dataType;
|
||||
self._get('user.address/lists', {}, function(res) {
|
||||
self.listData = res.data.list;
|
||||
self.default_id = res.data.default_id + '';
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
/*跳转页面*/
|
||||
addAddress() {
|
||||
let delta = 1;
|
||||
if (this.options.source === 'order') {
|
||||
delta = 2;
|
||||
}
|
||||
this.gotoPage('/pages/user/address/add/add?delta=' + delta);
|
||||
},
|
||||
|
||||
/*点击单选*/
|
||||
radioChange(e) {
|
||||
let self = this;
|
||||
self.default_id = e;
|
||||
self._post('user.address/setDefault', {
|
||||
address_id: e,
|
||||
}, function(res) {
|
||||
if (self.options.source === 'order') {
|
||||
// #ifndef H5
|
||||
uni.navigateBack();
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
history.go(-1);
|
||||
// #endif
|
||||
}
|
||||
});
|
||||
return false;
|
||||
|
||||
},
|
||||
|
||||
/*编辑地址*/
|
||||
editAddress(e) {
|
||||
this.gotoPage('/pages/user/address/edit/edit?address_id=' + e);
|
||||
},
|
||||
|
||||
/*删除地址*/
|
||||
delAddress(e) {
|
||||
let self = this;
|
||||
wx.showModal({
|
||||
title: "提示",
|
||||
content: "您确定要移除当前收货地址吗?",
|
||||
success: function(o) {
|
||||
o.confirm && self._get('user.address/delete', {
|
||||
address_id: e
|
||||
}, function(result) {
|
||||
if (result.code == 1) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
duration: 2000
|
||||
});
|
||||
self.getData();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.address-list {
|
||||
border-top: 16rpx solid #F2F2F2;
|
||||
padding: 0 20rpx;
|
||||
padding-bottom: 90rpx;
|
||||
}
|
||||
|
||||
.foot-btns {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.foot-btns .btn-red {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.none_add {
|
||||
padding: 314rpx 214rpx 60rpx 214rpx;
|
||||
}
|
||||
|
||||
.no_add {
|
||||
width: 322rpx;
|
||||
height: 180rpx;
|
||||
}
|
||||
|
||||
.no_add_add {
|
||||
width: 320rpx;
|
||||
height: 80rpx;
|
||||
border: 2rpx solid #FFB7B7;
|
||||
border-radius: 40rpx;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
font-size: 32rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
@include font_color('font_color');
|
||||
@include border_color('border_color');
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.add_add {
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
font-size: 26rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #0777CD;
|
||||
padding: 0 35rpx;
|
||||
border-bottom: 1rpx solid #D9D9D9;
|
||||
}
|
||||
|
||||
.defaul_add {
|
||||
padding: 9rpx 14rpx 10rpx 15rpx;
|
||||
@include background_color('bg-op');
|
||||
font-size: 22rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #F6220C;
|
||||
@include font_color('font_color');
|
||||
}
|
||||
|
||||
.add_icon_img {
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.none_line {
|
||||
width: 1rpx;
|
||||
height: 44rpx;
|
||||
background: #D9D9D9;
|
||||
}
|
||||
.add_add-btn{
|
||||
position: fixed;
|
||||
bottom: calc(env(safe-area-inset-bottom) + 20rpx);
|
||||
width:690rpx;
|
||||
margin: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.pbenv{
|
||||
padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
208
pages/user/address/edit/edit.vue
Normal file
208
pages/user/address/edit/edit.vue
Normal file
@ -0,0 +1,208 @@
|
||||
<template>
|
||||
<view class="address-form" :data-theme='theme()' :class="theme() || ''">
|
||||
<form @submit="formSubmit" @reset="formReset">
|
||||
<view class="bg-white p-0-30 f30">
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">收货人</text>
|
||||
<input class="ml20 f32 flex-1 p-30-0" name="name" type="text" v-model="address.name" placeholder-class="grary9"
|
||||
placeholder="请输入收货人姓名" />
|
||||
</view>
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">联系方式</text>
|
||||
<input class="ml20 f32 flex-1 p-30-0" name="phone" type="text" v-model="address.phone" placeholder-class="grary9"
|
||||
placeholder="请输入收货人手机号" />
|
||||
</view>
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">所在地区</text>
|
||||
<view class="input-box flex-1">
|
||||
<input class="ml20 f32 flex-1 p-30-0" type="text" value="" placeholder-class="grary9" placeholder="" v-model="selectCity"
|
||||
disabled="true" @click="showMulLinkageThreePicker" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-s-c border-b-d9">
|
||||
<text class="key-name">详细地址</text>
|
||||
<textarea class="ml20 flex-1 f32 p-30-0 lh150" name="detail" placeholder-class="grary9" :auto-height="true"
|
||||
v-model="address.detail" placeholder="请输入街道小区楼牌号等"></textarea>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p30"><button form-type="submit" class="theme-btn f32 mt60 addBtn">保存</button></view>
|
||||
</form>
|
||||
<mpvue-city-picker v-if="is_load" ref="mpvueCityPicker" :province="province" :city="city" :area="area" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm"></mpvue-city-picker>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue';
|
||||
export default {
|
||||
components: {
|
||||
mpvueCityPicker
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cityPickerValueDefault: [0, 0, 0],
|
||||
selectCity: '选择省,市,区',
|
||||
province_id: 0,
|
||||
city_id: 0,
|
||||
region_id: 0,
|
||||
/*地址id*/
|
||||
address_id: 0,
|
||||
/*地址数据*/
|
||||
address: {},
|
||||
/*地区*/
|
||||
region: {},
|
||||
is_load: false,
|
||||
province: [],
|
||||
city: [],
|
||||
area: [],
|
||||
};
|
||||
},
|
||||
onLoad(e) {
|
||||
this.address_id = e.address_id;
|
||||
},
|
||||
mounted() {
|
||||
/*获取地址数据*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
let address_id = self.address_id;
|
||||
self._get(
|
||||
'user.address/detail', {
|
||||
address_id: address_id
|
||||
},
|
||||
function(res) {
|
||||
self.address = res.data.detail;
|
||||
self.address_id = res.data.detail.address_id;
|
||||
self.province_id = res.data.detail.province_id;
|
||||
self.city_id = res.data.detail.city_id;
|
||||
self.region_id = res.data.detail.region_id;
|
||||
self.region = res.data.region;
|
||||
let add = '';
|
||||
var b = self.region.forEach(item => {
|
||||
add += item;
|
||||
});
|
||||
self.selectCity = add;
|
||||
self.province = res.data.regionData[0];
|
||||
self.city = res.data.regionData[1];
|
||||
self.area = res.data.regionData[2];
|
||||
self.is_load = true;
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/*提交地址*/
|
||||
formSubmit: function(e) {
|
||||
let self = this;
|
||||
var formdata = e.detail.value;
|
||||
formdata.province_id = self.province_id;
|
||||
formdata.city_id = self.city_id;
|
||||
formdata.region_id = self.region_id;
|
||||
formdata.address_id = self.address_id;
|
||||
formdata.region = self.region;
|
||||
|
||||
if (formdata.name == '') {
|
||||
uni.showToast({
|
||||
title: '请输入收货人姓名',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (formdata.phone == '') {
|
||||
uni.showToast({
|
||||
title: '请输入手机号码',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
/*let reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
|
||||
if (!reg.test(formdata.phone)) {
|
||||
uni.showToast({
|
||||
title: '手机号码格式不正确',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}*/
|
||||
|
||||
if (formdata.province_id == 0 || formdata.city_id == 0 || formdata.region_id) {
|
||||
if (formdata.detail == '') {
|
||||
uni.showToast({
|
||||
title: '请选择完整省市区',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
self._post('user.address/edit', formdata, function(res) {
|
||||
self.showSuccess(res.msg, function() {
|
||||
// #ifdef H5
|
||||
uni.navigateBack({
|
||||
delta: 2
|
||||
});
|
||||
//#endif
|
||||
// #ifndef H5
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
//#endif
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/*清空数据*/
|
||||
formReset: function(e) {
|
||||
console.log('清空数据');
|
||||
},
|
||||
|
||||
/*三级联动选择*/
|
||||
showMulLinkageThreePicker() {
|
||||
this.$refs.mpvueCityPicker.show();
|
||||
},
|
||||
|
||||
/*选择之后绑定*/
|
||||
onConfirm(e) {
|
||||
this.region = e.label.split(',');
|
||||
this.selectCity = e.label;
|
||||
this.province_id = e.cityCode[0];
|
||||
this.city_id = e.cityCode[1];
|
||||
this.region_id = e.cityCode[2];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.address-form {
|
||||
border-top: 16rpx solid #f2f2f2;
|
||||
}
|
||||
|
||||
.address-form .key-name {
|
||||
width: 140rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.address-form .btn-red {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
box-shadow: 0 8rpx 16rpx 0 rgba(226, 35, 26, .6);
|
||||
}
|
||||
|
||||
.addBtn {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
</style>
|
||||
596
pages/user/cash/apply.vue
Normal file
596
pages/user/cash/apply.vue
Normal file
@ -0,0 +1,596 @@
|
||||
<template>
|
||||
<view class="apply-cash" v-if="!loadding" :data-theme='theme()' :class="theme() || ''">
|
||||
<!--申请成功-->
|
||||
<view class="form-wrap ">
|
||||
<form @submit="formSubmit">
|
||||
<view class="d-b-s p32 cash-top" @click="isType=true">
|
||||
<view class="f28 gray6 mr32">提现到</view>
|
||||
<view class="flex-1 d-s-s" v-if="withdraw_type==10">
|
||||
<view>
|
||||
<image class="cash-icon mr16" src="/static/wx.png" mode=""></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="f32">微信钱包</view>
|
||||
<view class="f24 gray6 flex-1">实时到账</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-1 d-s-s" v-if="withdraw_type==30">
|
||||
<view>
|
||||
<image class="cash-icon mr16" src="/static/yhk.png" mode=""></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="f32">银行卡</view>
|
||||
<view class="f24 gray6 flex-1">预计2小时内到账</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-1 d-s-s" v-if="withdraw_type==20">
|
||||
<view>
|
||||
<image class="cash-icon mr16" src="/static/zfb.png" mode=""></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="f32">支付宝</view>
|
||||
<view class="f24 gray6 flex-1">实时到账</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="icon iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
<view class="border-top">
|
||||
<view class="border-box"></view>
|
||||
</view>
|
||||
<view class="p-0-32">
|
||||
<template v-if="withdraw_type==20">
|
||||
<view class="f28 mb16">提现支付宝</view>
|
||||
<view class="cash-input-item">
|
||||
<view class="input-label">姓名</view>
|
||||
<input class="p20 flex-1" name="alipay_name" type="text" value="" placeholder-class="grary"
|
||||
placeholder="请输入姓名" />
|
||||
</view>
|
||||
<view class="cash-input-item mb48">
|
||||
<view class="input-label">账号</view>
|
||||
<input class="p20 flex-1" name="alipay_account" type="text" value=""
|
||||
placeholder-class="grary" placeholder="请输入支付宝账号" />
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="withdraw_type==30">
|
||||
<view class="f28 mb16">提现银行卡</view>
|
||||
<view class="cash-input-item">
|
||||
<view class="input-label">开户名</view>
|
||||
<input class="p20 flex-1" name="bank_account" type="text" value="" placeholder-class="grary"
|
||||
placeholder="请输入开户名" />
|
||||
</view>
|
||||
<view class="cash-input-item">
|
||||
<view class="input-label">账号</view>
|
||||
<input class="p20 flex-1" name="bank_card" type="text" value="" placeholder-class="grary"
|
||||
placeholder="请输入银行卡号" />
|
||||
</view>
|
||||
<view class="cash-input-item mb48">
|
||||
<view class="input-label">开户行</view>
|
||||
<input class="p20 flex-1" name="bank_name" type="text" value="" placeholder-class="grary"
|
||||
placeholder="请输入开户行名称/地址" />
|
||||
</view>
|
||||
</template>
|
||||
<view class=" txje">提现金额</view>
|
||||
<view class="mb48">
|
||||
<view class="withd-bc">
|
||||
<view class="withd-bct">
|
||||
<view style="height: 100%;display: flex;align-items: center;">
|
||||
<text style="font-size: 48rpx;">¥</text>
|
||||
<input class="tx-inpt" name="money" v-model="money" type="number" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="withd-bcb f26" v-if="money*1>balance*1">
|
||||
<text class="red">输入金额超过可提现金额</text>
|
||||
</view>
|
||||
<view class="withd-bcb gray6 f26" v-else>
|
||||
可提现余额{{balance}}元,<text @click="getAll"
|
||||
class="dominant fb">全部提现</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-c-c" style="border: 16rpx solid #ffffff">
|
||||
<button v-if="money*1<=balance*1" type="primary" class="btn-red flex-1"
|
||||
@click="popup">提交申请</button>
|
||||
<button v-else disabled class="btn-red-disabled flex-1"
|
||||
@click="popup">提交申请</button>
|
||||
</view>
|
||||
<!-- <view class="login_index_seller_rule">
|
||||
<label class="">
|
||||
<radio class="radio" value="r1" :checked="ifchecked"
|
||||
@click="checkedme(false)" />
|
||||
</label>
|
||||
<text class="gray6">我已阅读并同意</text>
|
||||
<text class="dominant"
|
||||
@click="gotoPage('/pages/agent/cash/apply/webview')">《提现规则》</text>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<Popup :show="isPopup" :width='622' :padding="0" type="middle">
|
||||
<view class="ww100 box-s-b pop-improt pr">
|
||||
<view class="d-c-c mb48">
|
||||
<text class="f34 fb">实际到账</text>
|
||||
<view class="icon iconfont icon-guanbi" @click="hidePopupFunc(1)"></view>
|
||||
</view>
|
||||
<view class="tc f40 mb48 fb">
|
||||
¥<text class="f64">{{overMoney}}</text>
|
||||
</view>
|
||||
<view class="d-b-c mb60" style="line-height: 48rpx;">
|
||||
<view class="gray6 f28">提现比例</view>
|
||||
<view class="gray3 f28">{{cash_ratio}}%</view>
|
||||
</view>
|
||||
<button form-type="submit" class="submitbtn">确认提交</button>
|
||||
</view>
|
||||
</Popup>
|
||||
<Popup :show="isType" :width='750' :padding="0" type="bottom">
|
||||
<view class="ww100 box-s-b pop-improt typeof pr">
|
||||
<view class="d-c-c mb48">
|
||||
<text class="f34 fb">选择提现方式</text>
|
||||
<view class="close-text" @click="isType=false">取消</view>
|
||||
</view>
|
||||
<view class="d-b-c pop-type-item" @click="typeFunc(10)">
|
||||
<view class="mr16">
|
||||
<image class="cash-icon" src="/static/wx.png" mode=""></image>
|
||||
</view>
|
||||
<view class="d-b-c flex-1">
|
||||
<view class="flex-1 tl">
|
||||
<view class="f32 gray72 mb6">微信钱包</view>
|
||||
<view class="f24 gray6">实时到账</view>
|
||||
</view>
|
||||
<view class="select-img" v-if="pop_type==10">
|
||||
<image src="/static/select.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-b-c pop-type-item" @click="typeFunc(20)">
|
||||
<view class="mr16">
|
||||
<image class="cash-icon" src="/static/zfb.png" mode=""></image>
|
||||
</view>
|
||||
<view class="d-b-c flex-1">
|
||||
<view class="flex-1 tl">
|
||||
<view class="f32 gray72 mb6">支付宝</view>
|
||||
<view class="f24 gray6">实时到账</view>
|
||||
</view>
|
||||
<view class="select-img" v-if="pop_type==20">
|
||||
<image src="/static/select.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-b-c pop-type-item" @click="typeFunc(30)">
|
||||
<view class="mr16">
|
||||
<image class="cash-icon" src="/static/yhk.png" mode=""></image>
|
||||
</view>
|
||||
<view class="d-b-c flex-1">
|
||||
<view class="flex-1 tl">
|
||||
<view class="f32 gray72 mb6">银行卡</view>
|
||||
<view class="f24 gray6">预计2小时内到账</view>
|
||||
</view>
|
||||
<view class="select-img" v-if="pop_type==30">
|
||||
<image src="/static/select.png" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button @click="selectType" class="submitbtn">确定</button>
|
||||
</view>
|
||||
</Popup>
|
||||
</form>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Popup from '@/components/uni-popup.vue';
|
||||
export default {
|
||||
components: {
|
||||
Popup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loadding: true,
|
||||
/*是否加载完成*/
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
/*支付类别*/
|
||||
withdraw_type: 10,
|
||||
agent: {},
|
||||
payType: [],
|
||||
words: {},
|
||||
/*小程序订阅消息*/
|
||||
temlIds: [],
|
||||
money: '',
|
||||
ifchecked: false,
|
||||
url: '',
|
||||
isPopup: false,
|
||||
cash_ratio: 0,
|
||||
cash_ratioMoney: '',
|
||||
overMoney: '',
|
||||
isType: false,
|
||||
pop_type: 10,
|
||||
balance:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
onLoad() {
|
||||
// this.url = this.config.app_url + '/agreement/cash.docx';
|
||||
},
|
||||
watch: {
|
||||
'money': function(n, o) {
|
||||
let self = this;
|
||||
if (n != o) {
|
||||
self.cash_ratioMoney = self.cash_ratio_percent();
|
||||
self.overMoney = self.overprice();
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
typeFunc(n) {
|
||||
this.pop_type = n;
|
||||
},
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
self.loadding = true;
|
||||
self._get('user.cash/index', {
|
||||
platform: self.getPlatform()
|
||||
}, function(res) {
|
||||
self.balance = res.data.balance;
|
||||
self.cash_ratio = res.data.cash_ratio;
|
||||
// self.payType = self.agent.settlement.pay_type;
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
checkedme(e) {
|
||||
let self = this;
|
||||
self.ifchecked = !self.ifchecked;
|
||||
},
|
||||
/*切换提现方式*/
|
||||
TabType(e) {
|
||||
this.withdraw_type = e;
|
||||
},
|
||||
selectType() {
|
||||
this.withdraw_type = this.pop_type;
|
||||
this.isType = false;
|
||||
},
|
||||
/*判断是否存在*/
|
||||
hasType(e) {
|
||||
if (this.payType.indexOf(e) != -1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
popup() {
|
||||
this.isPopup = true;
|
||||
},
|
||||
hidePopupFunc() {
|
||||
this.isPopup = false;
|
||||
},
|
||||
getAll() {
|
||||
this.money = this.balance;
|
||||
},
|
||||
// openDoc(e) {
|
||||
// var that = this;
|
||||
// var filePath = e.currentTarget.dataset.url; //对应的网络路径,可以是内网的或者外网
|
||||
// var fileType = e.currentTarget.dataset.type;
|
||||
// console.log(filePath)
|
||||
// wx.downloadFile({ //下载对应文件
|
||||
// url: filePath,
|
||||
// filePath: wx.env.USER_DATA_PATH + "/汇乐宝提现规则.docx",
|
||||
// success: function(res) {
|
||||
// var filePath = res.filePath; //文件路径
|
||||
// wx.openDocument({
|
||||
// filePath: filePath, // 装载对应文件的路径
|
||||
// fileType: fileType, // 指定打开的文件类型
|
||||
// showMenu: true, // 右上角的菜单转发分享操作
|
||||
// success: function(res) {
|
||||
// console.log("打开成功");
|
||||
// },
|
||||
// fail: function(res) {}
|
||||
// })
|
||||
// },
|
||||
// fail: function(res) {
|
||||
// console.log(res);
|
||||
// }
|
||||
// })
|
||||
// },
|
||||
cash_ratio_percent() {
|
||||
let money = this.money;
|
||||
let num = money * this.cash_ratio / 100;
|
||||
num=num.toFixed(2);
|
||||
return num
|
||||
},
|
||||
overprice() {
|
||||
let money = this.money * this.cash_ratio / 100;
|
||||
money = money.toFixed(2);
|
||||
console.log(money)
|
||||
return money
|
||||
},
|
||||
/*申请*/
|
||||
formSubmit: function(e) {
|
||||
console.log(111)
|
||||
let self = this;
|
||||
var formdata = e.detail.value;
|
||||
formdata.pay_type = self.withdraw_type;
|
||||
// if (self.ifchecked != true) {
|
||||
// uni.showToast({
|
||||
// title: '请阅读并勾选《提现规则》',
|
||||
// duration: 1000,
|
||||
// icon: 'none'
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
var data = JSON.stringify(formdata);
|
||||
uni.showLoading({
|
||||
title: '正在提交',
|
||||
mask: true
|
||||
})
|
||||
self._post('user.cash/submit', {
|
||||
data: data
|
||||
}, function(res) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '申请成功',
|
||||
duration: 2000,
|
||||
icon: 'success'
|
||||
});
|
||||
uni.navigateBack();
|
||||
},(err)=>{
|
||||
self.isPopup=false;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
.dominant {
|
||||
@include font_color("font_color");
|
||||
}
|
||||
|
||||
.txje {
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 500;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.apply-cash {
|
||||
/* padding-top: 16rpx; */
|
||||
}
|
||||
|
||||
.form-wrap {
|
||||
/* border-radius: 20rpx; */
|
||||
// background: #FFFFFF;
|
||||
/* box-shadow: 0 0 16rpx 0 rgba(0, 0, 0, .2); */
|
||||
}
|
||||
|
||||
.form-item {
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.form-item .field-name {
|
||||
width: 140rpx;
|
||||
}
|
||||
|
||||
.form-item input {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.form-item .text-price {
|
||||
padding: 0 10rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
|
||||
.agreement-content {
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.iconfont.icon-xuanze {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.form-item .active .iconfont.icon-xuanze {
|
||||
color: #F6220C;
|
||||
}
|
||||
|
||||
.apply-cash .btn-red {
|
||||
width: 686rpx;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
@include background_color("background_color");
|
||||
opacity: 1;
|
||||
border-radius: 16rpx;
|
||||
border: none;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.apply-cash .btn-red-disabled {
|
||||
width: 686rpx;
|
||||
height: 96rpx;
|
||||
line-height: 96rpx;
|
||||
background-color: #F5F5F5;
|
||||
background: #F5F5F5;
|
||||
opacity: 1;
|
||||
border-radius: 16rpx;
|
||||
color: rgba(0, 0, 0, 0.24);
|
||||
border: none;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.withd-b {
|
||||
background-color: #FFFFFF;
|
||||
margin-bottom: 97rpx;
|
||||
}
|
||||
|
||||
.withd-bct {
|
||||
height: 92rpx;
|
||||
padding-top: 59rpx;
|
||||
padding-right: 49rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid #d0d0d0;
|
||||
}
|
||||
|
||||
.tx-inpt {
|
||||
background-color: #FFFFFF;
|
||||
font-size: 48rpx;
|
||||
line-height: 92rpx;
|
||||
}
|
||||
|
||||
.withd-bcb {
|
||||
padding: 27rpx 0 49rpx 0;
|
||||
}
|
||||
|
||||
.withdrawal-btn {
|
||||
margin: 0 30rpx;
|
||||
@include background_color("background_color");
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
color: #FFFFFF;
|
||||
text-align: center;
|
||||
border-radius: 30rpx;
|
||||
padding: 0;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.login_index_seller_rule {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.radio {
|
||||
transform: scale(0.7)
|
||||
}
|
||||
|
||||
.pop-improt {
|
||||
width: 622rpx;
|
||||
height:480rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx;
|
||||
}
|
||||
|
||||
.pop-improt .icon-guanbi {
|
||||
position: absolute;
|
||||
top: 32rpx;
|
||||
right: 32rpx;
|
||||
width: 30rpx;
|
||||
height: 30rpx;
|
||||
font-size: 26rpx;
|
||||
color: #666666;
|
||||
|
||||
}
|
||||
|
||||
.pop-improt.typeof {
|
||||
width: 750rpx;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.pop-improt .close-text {
|
||||
position: absolute;
|
||||
top: 32rpx;
|
||||
left: 32rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
@include font_color("font_color");
|
||||
|
||||
}
|
||||
|
||||
.submitbtn {
|
||||
width: 558rpx;
|
||||
height: 80rpx;
|
||||
@include background_color("background_color");
|
||||
opacity: 1;
|
||||
border-radius: 16rpx;
|
||||
font-size: 28rpx;
|
||||
font-family: PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #FFFFFF;
|
||||
line-height: 80rpx;
|
||||
opacity: 1;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.cash-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.select-img {
|
||||
image{
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.pop-type-item {
|
||||
height: 138rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 0px;
|
||||
}
|
||||
|
||||
.cash-input-item {
|
||||
height: 88rpx;
|
||||
background: #FFFFFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
.input-label{
|
||||
width: 160rpx;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.cash-top {
|
||||
height: 146rpx;
|
||||
box-sizing: border-box;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
.border-box{
|
||||
box-sizing: border;
|
||||
border-radius: 40rpx 40rpx 0px 0px;
|
||||
background-color: #FFFFFF;
|
||||
height: 58rpx;
|
||||
width: 100%;
|
||||
}
|
||||
height: 58rpx;
|
||||
width: 100%;
|
||||
background-color: #f5f5f5;
|
||||
|
||||
}
|
||||
.mb48{
|
||||
margin-bottom: 48rpx;
|
||||
}
|
||||
.mb60{
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
</style>
|
||||
153
pages/user/cash/list.vue
Normal file
153
pages/user/cash/list.vue
Normal file
@ -0,0 +1,153 @@
|
||||
<template>
|
||||
<view>
|
||||
<!--列表-->
|
||||
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
|
||||
@scrolltoupper="scrolltoupperFunc" @scrolltolower="scrolltolowerFunc">
|
||||
<view class="p-0-30 bg-white">
|
||||
<view class="d-b-c border-b p-20-0" v-for="(item,index) in tableData" :key="index">
|
||||
<view class="d-s-s f-w d-c flex-1">
|
||||
<text class="30">提现</text>
|
||||
<text class="gray9 f22">{{item.create_time}}</text>
|
||||
</view>
|
||||
<view class="d-s-e f-w d-c">
|
||||
<text class="red"> {{ item.money }}元</text>
|
||||
<text
|
||||
:class="item.apply_status.text=='审核通过'?'green':'gray9'">{{ item.apply_status.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--<view class="">
|
||||
<view class="bottom-refresh">
|
||||
<view class="d-c-c p30" v-if="tableData.length && no_more">
|
||||
<text class="gray3">亲, 没有更多了</text>
|
||||
</view>
|
||||
<view v-if="loading" class="d-c-c p30">
|
||||
<text class="gray3">加载中...</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>-->
|
||||
<!-- 没有记录 -->
|
||||
<view class="d-c-c p30" v-if="tableData.length==0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from "@/components/uni-load-more.vue";
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
/*手机高度*/
|
||||
phoneHeight: 0,
|
||||
/*可滚动视图区域高度*/
|
||||
scrollviewHigh: 0,
|
||||
/*状态选中*/
|
||||
state_active: -1,
|
||||
/*数据列表*/
|
||||
tableData: [],
|
||||
no_more: false,
|
||||
loading: true,
|
||||
/*最后一页码数*/
|
||||
last_page: 0,
|
||||
/*当前页面*/
|
||||
page: 1,
|
||||
/*每页条数*/
|
||||
list_rows: 20,
|
||||
tableList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
||||
/*加载中状态*/
|
||||
loadingType() {
|
||||
if (this.loading) {
|
||||
return 1;
|
||||
} else {
|
||||
if (this.tableData.length != 0 && this.no_more) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
/*初始化*/
|
||||
this.init();
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*初始化*/
|
||||
init() {
|
||||
let self = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
self.phoneHeight = res.windowHeight;
|
||||
self.scrollviewHigh = res.windowHeight;
|
||||
}
|
||||
});
|
||||
},
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
let page = self.page;
|
||||
self.loading = true;
|
||||
let list_rows = self.list_rows;
|
||||
self._get('user.cash/lists', {
|
||||
status: -1,
|
||||
page: page || 1,
|
||||
list_rows: list_rows,
|
||||
}, function(data) {
|
||||
self.loading = false;
|
||||
self.tableData = self.tableData.concat(data.data.list.data);
|
||||
self.last_page = data.data.list.last_page;
|
||||
if (data.data.list.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*切换*/
|
||||
stateFunc(e) {
|
||||
let self = this;
|
||||
if (e != self.state_active) {
|
||||
self.tableData = [];
|
||||
self.page = 1;
|
||||
self.state_active = e;
|
||||
self.getData();
|
||||
}
|
||||
},
|
||||
|
||||
/*可滚动视图区域到顶触发*/
|
||||
scrolltoupperFunc() {
|
||||
console.log('滚动视图区域到顶');
|
||||
},
|
||||
|
||||
/*可滚动视图区域到底触发*/
|
||||
scrolltolowerFunc() {
|
||||
let self = this;
|
||||
if (self.page < self.last_page) {
|
||||
self.page++;
|
||||
self.getData();
|
||||
}
|
||||
self.no_more = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
201
pages/user/evaluate/list.vue
Normal file
201
pages/user/evaluate/list.vue
Normal file
@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<view :data-theme="theme()" :class="theme() || ''">
|
||||
<view class="list">
|
||||
<view class="listItem" v-for="(item,index) in list" :key="index">
|
||||
<view class="timeBox">
|
||||
<view class="time">
|
||||
<span class="data">{{ item.data }}</span>
|
||||
<span class="line"></span>
|
||||
<span class="mouth">{{ item.mouth }}<span class="unit">月</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="year">{{ item.year }}<span class="unit">年</span></span>
|
||||
</view>
|
||||
<view class="delTxt" @click="del(item,index)">删除</view>
|
||||
</view>
|
||||
|
||||
<view class="con">
|
||||
<view>{{ item.content }}</view>
|
||||
<image class="img" mode="aspectFit" :src="v.file_path" v-for="(v,idx) in item.image" :key="idx"></image>
|
||||
</view>
|
||||
<view class="prodcut" v-if="item.OrderProduct">
|
||||
<image v-if="item.OrderProduct.image" :src="item.OrderProduct.image.file_path" model="aspectFit"></image>
|
||||
<view class="r">
|
||||
<view class="title">{{ item.OrderProduct.product_name }}</view>
|
||||
<view class="spec">{{ item.OrderProduct.product_attr }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-c-c p30" v-if="list.length == 0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
state_active: 0,
|
||||
list: [],
|
||||
last_page: 0,
|
||||
no_more: false,
|
||||
page: 1,
|
||||
}
|
||||
},
|
||||
onLoad: function(options) {
|
||||
// this.options = options;
|
||||
},
|
||||
onShow: function() {
|
||||
this.page = 1;
|
||||
this.list = [];
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
/*获取地址列表*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
self.loading = true;
|
||||
self._post(
|
||||
'product.comment/userLists',
|
||||
{
|
||||
page: self.page,
|
||||
list_rows: 10,
|
||||
},
|
||||
function(res) {
|
||||
if(res.data.list.data && res.data.list.data.length > 0){
|
||||
res.data.list.data.forEach((v)=>{
|
||||
v.year = v.create_time.substr(0,4);
|
||||
v.mouth = v.create_time.substr(5,2);
|
||||
v.data = v.create_time.substr(8,2);
|
||||
})
|
||||
}
|
||||
self.list = self.list.concat(res.data.list.data);
|
||||
self.last_page = res.data.lastPage;
|
||||
self.loading = false;
|
||||
if (self.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
return false;
|
||||
}
|
||||
uni.hideLoading();
|
||||
}
|
||||
);
|
||||
},
|
||||
del(v,index){
|
||||
let self = this;
|
||||
wx.showModal({
|
||||
title: '提示',
|
||||
content: '您确定删除该评论吗?',
|
||||
success: function(o) {
|
||||
if (o.confirm) {
|
||||
self._post(
|
||||
'product.comment/delete',
|
||||
{
|
||||
comment_id: v.comment_id,
|
||||
},
|
||||
function(res) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
duration: 1000,
|
||||
icon: 'none'
|
||||
});
|
||||
self.list.splice(index,1)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onReachBottom(){
|
||||
let self = this;
|
||||
if (self.no_more) {
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
if (self.page <= self.last_page) {
|
||||
self.getData();
|
||||
} else {
|
||||
self.no_more = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #EBEBEB;
|
||||
}
|
||||
.list{
|
||||
padding: 20rpx;
|
||||
}
|
||||
.listItem{
|
||||
background-color: #fff;
|
||||
padding: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
.timeBox{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.delTxt{
|
||||
color: #FD6A03;
|
||||
}
|
||||
.time{
|
||||
.unit{
|
||||
color:rgba(0,0,0,0.9);
|
||||
font-weight: 400;
|
||||
}
|
||||
span{
|
||||
font-size: 26rpx;
|
||||
color: #000000;
|
||||
font-weight: 800;
|
||||
}
|
||||
.data{
|
||||
font-size: 38rpx;
|
||||
}
|
||||
.line{
|
||||
width: 4rpx;
|
||||
height: 22rpx;
|
||||
background-color: #FD6A03;
|
||||
display: inline-block;
|
||||
margin: 0 6rpx;
|
||||
transform: rotate(18deg);
|
||||
}
|
||||
}
|
||||
.con{
|
||||
letter-spacing: 1rpx;
|
||||
line-height: 42rpx;
|
||||
margin: 60rpx 0 30rpx 0;
|
||||
.img{
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
display: inline-block;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
}
|
||||
.prodcut{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: rgba(235,235,235,0.8);
|
||||
font-size: 26rpx;
|
||||
image{
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
margin-right: 6rpx;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
.spec{
|
||||
color: #959595;
|
||||
font-size: 24rpx;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
263
pages/user/favorite/favorite.vue
Normal file
263
pages/user/favorite/favorite.vue
Normal file
@ -0,0 +1,263 @@
|
||||
<template>
|
||||
<view class="shop_body">
|
||||
<scroll-view scroll-y="true" :style="'height:' + scrollviewHigh + 'px;'" class="scroll-Y" lower-threshold="50"
|
||||
@scrolltolower="scrolltolowerFunc">
|
||||
<view class="shop_body_l_item" v-for="(item,index) in product_list" :key="index">
|
||||
<image :src="item.product_image" @click="goto_product(item.product_id)" image>
|
||||
<view class="shop_body_l_item_info" @click="goto_product(item.product_id)">
|
||||
<view class="shop_body_l_item_info_title h1">{{item.product_name}}</view>
|
||||
<view class="shop_body_l_item_info_price">
|
||||
<view class="h2 red">¥<text class="h1">{{item.product_price}}</text></view>
|
||||
<view class="h4 huaxianjia">¥<text class="h3">{{item.line_price}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="default" @click="cancelFav(item.product_id)">取消关注</button>
|
||||
</view>
|
||||
<view class="d-c-c p30" v-if="product_list.length==0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from "@/components/uni-load-more.vue";
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*底部加载*/
|
||||
loading: true,
|
||||
/*没有更多*/
|
||||
no_more: false,
|
||||
//页面高度
|
||||
scrollviewHigh: '',
|
||||
//商品列表
|
||||
product_list: [],
|
||||
//当前页
|
||||
page: 1,
|
||||
//总页数
|
||||
last_page: '',
|
||||
isfollow:'',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
/*加载中状态*/
|
||||
loadingType() {
|
||||
if (this.loading) {
|
||||
return 1;
|
||||
} else {
|
||||
if (this.product_list.length != 0 && this.no_more) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.init();
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*初始化*/
|
||||
init() {
|
||||
let self = this;
|
||||
self.page=1;
|
||||
self.product_list=[];
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
self.scrollviewHigh = res.windowHeight;
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取数据
|
||||
getData() {
|
||||
let self = this;
|
||||
self.loading = true;
|
||||
self._post('user.Favorite/list', {
|
||||
page: self.page,
|
||||
type: 20,
|
||||
list_rows: 15,
|
||||
}, (res) => {
|
||||
self.loading = false;
|
||||
self.last_page = res.data.list.last_page;
|
||||
self.product_list = self.product_list.concat(res.data.list.data);
|
||||
if (res.data.list.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
} else {
|
||||
self.no_more = false;
|
||||
}
|
||||
})
|
||||
},
|
||||
/*可滚动视图区域到底触发*/
|
||||
scrolltolowerFunc() {
|
||||
let self = this;
|
||||
if (self.no_more) {
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
if (self.page <= self.last_page) {
|
||||
self.getData();
|
||||
} else {
|
||||
self.no_more = true;
|
||||
}
|
||||
},
|
||||
goto_product(e){
|
||||
this.gotoPage('pages/product/detail/detail?product_id=' + e);
|
||||
},
|
||||
//取消收藏
|
||||
cancelFav(product_id) {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
title: '正在取消'
|
||||
});
|
||||
self._post('user.favorite/fav', {
|
||||
product_id: product_id
|
||||
}, (res) => {
|
||||
uni.hideLoading();
|
||||
self.page = 1;
|
||||
self.product_list = [];
|
||||
self.getData();
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.h1 {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.h2 {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.h3 {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.h4 {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.h5 {
|
||||
font-size: 16rpx;
|
||||
}
|
||||
|
||||
.h6 {
|
||||
font-size: 12rpx;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: $dominant-color;
|
||||
}
|
||||
|
||||
.huaxianjia {
|
||||
text-decoration: line-through;
|
||||
color: #585858;
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.shop_body {
|
||||
width: 100%;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
|
||||
.shop_body_l_item {
|
||||
width: 90%;
|
||||
height: 250rpx;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
border-radius: 15rpx;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.shop_body_l_item image {
|
||||
width: 34.5%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.shop_body_l_item_info {
|
||||
width: 65.5%;
|
||||
height: 170rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-direction: column;
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.shop_body_l_item_info_title {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
text-overflow: ellipsis;
|
||||
-webkit-box-orient: vertical;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.shop_body_l_item_info_price {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
color: $dominant-color;
|
||||
}
|
||||
|
||||
.shop_body_l_item_info_price view {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.shop_body_l_item_info_others {
|
||||
width: 100%;
|
||||
height: 30rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.shop_body_l_item_info_others_activity {
|
||||
width: 150rpx;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
border: 1rpx #E22319 solid;
|
||||
border-radius: 30rpx;
|
||||
/* font-size: 16rpx; */
|
||||
color: #E22319;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.shop_body_l_item_info_others_sales {
|
||||
color: #585858;
|
||||
}
|
||||
|
||||
.shop_body_l_item button {
|
||||
font-size: 24rpx;
|
||||
width: 120rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
padding: 0;
|
||||
background-image: linear-gradient(90deg, #F11E0B, #F77737);
|
||||
color: white;
|
||||
position: absolute;
|
||||
top: 165rpx;
|
||||
left: 530rpx;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
633
pages/user/index/index.vue
Normal file
633
pages/user/index/index.vue
Normal file
@ -0,0 +1,633 @@
|
||||
<template>
|
||||
<view :data-theme='theme()' :class="theme() || ''">
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<header-bar></header-bar>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="user-index" v-if="!loadding">
|
||||
<!--个人信息-->
|
||||
<view class="user-header">
|
||||
<view class="user-header-inner">
|
||||
<view class="user-info">
|
||||
<view class="photo">
|
||||
<image :src="detail.avatarUrl" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="d-c-c mb23">
|
||||
<view class="name">{{ detail.nickName }}</view>
|
||||
<text class="ml20 grade" v-if="detail.grade_id > 0">
|
||||
{{ detail.grade.name }}
|
||||
</text>
|
||||
</view>
|
||||
<view class="tel d-s-c">
|
||||
<text class="f26">ID:{{ detail.user_id }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--我的订单-->
|
||||
|
||||
<view class="my-order">
|
||||
<view class="list d-a-c flex-1">
|
||||
<view class="item d-c-c d-c" @click="jumpPage('/pages/user/my-wallet/my-wallet')">
|
||||
<view class=" red_mini">{{ detail.balance }}</view>
|
||||
<text class="pt16 f24 gray3">账号余额</text>
|
||||
</view>
|
||||
<view class="item order_center d-c-c d-c" @click="jumpPage('/pages/user/points/points')">
|
||||
<view class=" red_mini">{{ detail.points }}</view>
|
||||
<text class="pt16 f24 gray3">{{points_name()}}</text>
|
||||
</view>
|
||||
<view class="item d-c-c d-c" @click="jumpPage('/pages/user/my-coupon/my-coupon')">
|
||||
<view class="red_mini">{{ coupon }}</view>
|
||||
<text class="pt16 f24 gray3">优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bind_phone" v-if="!detail.mobile">
|
||||
<view class="bind_content">
|
||||
<view class="bind_txt">确保账户安全,请绑定手机号</view>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button open-type="getPhoneNumber" class="bind_btn" @getphonenumber="getPhoneNumber">去绑定</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<button class="bind_btn" @click="bindMobile">去绑定</button>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
<!--我的资产-->
|
||||
<view class="my-assets">
|
||||
<view class="my-assets-all">
|
||||
<view class="f30 fb">我的订单</view>
|
||||
<view class="gray9 f26" @click="jumpPage('/pages/order/myorder?dataType=all')">全部订单<text
|
||||
class="icon iconfont icon-jiantou"></text></view>
|
||||
</view>
|
||||
<view class="d-b-c w100">
|
||||
<view class="item" @click="jumpPage('/pages/order/myorder?dataType=payment')">
|
||||
<view class="icon-box pr">
|
||||
<image src="/static/icon/icon-icon.png" mode=""></image>
|
||||
<text class="dot d-c-c"
|
||||
v-if="orderCount.payment != null && orderCount.payment > 0">{{ orderCount.payment }}</text>
|
||||
</view>
|
||||
<text>待付款</text>
|
||||
</view>
|
||||
<view class="item" @click="jumpPage('/pages/order/myorder?dataType=delivery')">
|
||||
<view class="icon-box pr">
|
||||
<image src="/static/icon/icon-daifahuo.png" mode=""></image>
|
||||
<text class="dot d-c-c"
|
||||
v-if="orderCount.delivery != null && orderCount.delivery > 0">{{ orderCount.delivery }}</text>
|
||||
</view>
|
||||
<text class="">待发货</text>
|
||||
</view>
|
||||
<view class="item" @click="jumpPage('/pages/order/myorder?dataType=received')">
|
||||
<view class="icon-box pr">
|
||||
<image src="/static/icon/icon-daishouhuo.png" mode=""></image>
|
||||
<text class="dot d-c-c"
|
||||
v-if="orderCount.received != null && orderCount.received > 0">{{ orderCount.received }}</text>
|
||||
</view>
|
||||
<text>待收货</text>
|
||||
</view>
|
||||
<view class="item" @click="jumpPage('/pages/order/myorder?dataType=comment')">
|
||||
<view class="icon-box pr">
|
||||
<image src="/static/icon/icon-quanbudingdan.png" mode=""></image>
|
||||
<text class="dot d-c-c"
|
||||
v-if="orderCount.comment != null && orderCount.comment > 0">{{ orderCount.comment }}</text>
|
||||
</view>
|
||||
<text>待评价</text>
|
||||
</view>
|
||||
<view class="item" @click="jumpPage('/pages/order/refund/index/index')">
|
||||
<view class="icon-box pr">
|
||||
<image src="/static/icon/icon-tuikuan.png" mode=""></image>
|
||||
<text class="dot d-c-c"
|
||||
v-if="orderCount.refund != null && orderCount.refund > 0">{{ orderCount.refund }}</text>
|
||||
</view>
|
||||
<text>退款/售后</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--菜单-->
|
||||
<view class="menu-wrap">
|
||||
<view class="my-assets-all p-0-30">
|
||||
<view class="f30 fb">我的服务</view>
|
||||
</view>
|
||||
<view class="group-bd f-w">
|
||||
<view :class="'item ' + item.icon + '-box'" v-for="(item, index) in menus" :key="index"
|
||||
@click="jumpPage(item.path)">
|
||||
<view class="icon-round d-c-c">
|
||||
<image class="icon-round" :src="item.icon" mode="aspectFill"></image>
|
||||
</view>
|
||||
<text class="name">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="invitation.is_open && invitation.invitation_id > 0">
|
||||
<view class="activity_img" @click="toinvitation(invitation.invitation_id)">
|
||||
<image :src="invitation.image" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
<!--推荐-->
|
||||
<view>
|
||||
<recommendProduct :location="20"></recommendProduct>
|
||||
</view>
|
||||
</view>
|
||||
<tabBar></tabBar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import recommendProduct from '@/components/recommendProduct/recommendProduct.vue';
|
||||
export default {
|
||||
components: {
|
||||
recommendProduct
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*签到数据*/
|
||||
sign: {},
|
||||
/*是否加载完成*/
|
||||
loadding: true,
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
/*菜单*/
|
||||
menus: [],
|
||||
invitation: {},
|
||||
detail: {
|
||||
balance: 0,
|
||||
points: 0,
|
||||
grade: {
|
||||
name: ''
|
||||
},
|
||||
},
|
||||
orderCount: {},
|
||||
coupon: 0,
|
||||
setting: {},
|
||||
user_type: '', //用户状态
|
||||
sessionKey: ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
/*获取个人中心数据*/
|
||||
this.getData();
|
||||
this.getTabBarLinks();
|
||||
},
|
||||
onLoad(e) {
|
||||
let self = this;
|
||||
if (e.invitation_id) {
|
||||
uni.setStorageSync('invitation_id', e.invitation_id);
|
||||
}
|
||||
if (e.referee_id) {
|
||||
uni.setStorageSync('referee_id', e.referee_id);
|
||||
}
|
||||
//#ifdef MP-WEIXIN
|
||||
wx.login({
|
||||
success(res) {
|
||||
// 发送用户信息
|
||||
self._post('user.user/getSession', {
|
||||
code: res.code
|
||||
}, result => {
|
||||
self.sessionKey = result.data.session_key;
|
||||
});
|
||||
}
|
||||
});
|
||||
//#endif
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
self._post('user.index/detail', {
|
||||
source: self.getPlatform()
|
||||
}, function(res) {
|
||||
//#ifdef MP-WEIXIN
|
||||
if (res.data.getPhone) {
|
||||
//#ifdef MP-WEIXIN
|
||||
self.gotoPage('/pages/login/bindmobile');
|
||||
//#endif
|
||||
//#ifndef MP-WEIXIN
|
||||
self.bindMobile();
|
||||
//#endif
|
||||
return;
|
||||
}
|
||||
//#endif
|
||||
self.detail = res.data.userInfo;
|
||||
self.sign = res.data.sign;
|
||||
self.coupon = res.data.coupon;
|
||||
self.orderCount = res.data.orderCount;
|
||||
self.menus = res.data.menus;
|
||||
self.invitation = res.data.invitation;
|
||||
self.setting = res.data.setting;
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
bindMobile() {
|
||||
this.gotoPage("/pages/user/modify-phone/modify-phone");
|
||||
},
|
||||
/*跳转页面*/
|
||||
jumpPage(path) {
|
||||
this.gotoPage(path);
|
||||
},
|
||||
toinvitation(id) {
|
||||
if (id == 0) {
|
||||
uni.showToast({
|
||||
title: '暂无活动'
|
||||
})
|
||||
} else {
|
||||
this.gotoPage('/pages/user/invite/invite?invitation_gift_id=' + id);
|
||||
}
|
||||
},
|
||||
getPhoneNumber(e) {
|
||||
var self = this;
|
||||
console.log(e.detail);
|
||||
if (e.detail.errMsg !== 'getPhoneNumber:ok') {
|
||||
return false;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: "正在提交",
|
||||
mask: true
|
||||
});
|
||||
// 发送用户信息
|
||||
self._post('user.user/bindMobile', {
|
||||
session_key: self.sessionKey,
|
||||
encrypted_data: e.detail.encryptedData,
|
||||
iv: e.detail.iv,
|
||||
}, result => {
|
||||
uni.showToast({
|
||||
title: '绑定成功'
|
||||
});
|
||||
// 执行回调函数
|
||||
self.detail.mobile = result.data.mobile;
|
||||
}, false, () => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #EBEBEB;
|
||||
}
|
||||
|
||||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.foot_ {
|
||||
height: 98rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.user-header {
|
||||
position: relative;
|
||||
@include background_color('background_color');
|
||||
}
|
||||
|
||||
.user-header .user-header-inner {
|
||||
position: relative;
|
||||
padding: 30rpx 30rpx 120rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
margin-bottom: 100rpx;
|
||||
}
|
||||
|
||||
.user-header .user-header-inner::after,
|
||||
.user-header .user-header-inner::before {
|
||||
display: block;
|
||||
content: '';
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.user-header .user-header-inner::after {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
right: -100rpx;
|
||||
bottom: -200rpx;
|
||||
background-image: radial-gradient(90deg, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0));
|
||||
}
|
||||
|
||||
.user-header .user-header-inner::before {
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
left: -60rpx;
|
||||
top: -20rpx;
|
||||
background-image: radial-gradient(-90deg, rgba(255, 255, 255, 0.2) 10%, rgba(255, 255, 255, 0));
|
||||
}
|
||||
|
||||
.user-header .user-info {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.user-header .photo,
|
||||
.user-header .photo image {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-header .photo {
|
||||
border: 4rpx solid #ffffff;
|
||||
}
|
||||
|
||||
.user-header .info {
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.user-header .info .name {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.user-header .info .tel {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.user-header .info .grade {
|
||||
display: block;
|
||||
padding: 0 16rpx;
|
||||
font-size: 22rpx;
|
||||
/* height: 36rpx; */
|
||||
line-height: 36rpx;
|
||||
border-radius: 40rpx;
|
||||
background-color:rgba($color: #000000, $alpha: 0.1);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.user-header .sign-box {
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
padding: 0 10rpx;
|
||||
height: 50rpx;
|
||||
border: 1px solid #ffe300;
|
||||
border-radius: 25rpx;
|
||||
font-size: 24rpx;
|
||||
color: #ffe300;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.user-header .sign-box .iconfont {
|
||||
color: #ffe300;
|
||||
}
|
||||
|
||||
.user-header .my-order {
|
||||
position: absolute;
|
||||
padding: 0 30rpx;
|
||||
/* height: 240rpx; */
|
||||
right: 20rpx;
|
||||
bottom: -75rpx;
|
||||
left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 16rpx;
|
||||
/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
|
||||
background: #ffffff;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.order_center {
|
||||
border-left: 1rpx solid #D9D9D9;
|
||||
border-right: 1rpx solid #D9D9D9;
|
||||
}
|
||||
|
||||
.my-order .item {
|
||||
display: flex;
|
||||
margin: 20rpx 0;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 26rpx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.my-assets .icon-box image {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.my-order .icon-box,
|
||||
.my-assets .icon-box {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.my-order .icon-box .iconfont,
|
||||
.my-assets .icon-box .iconfont {
|
||||
font-size: 50rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.my-assets .icon-box .dot {
|
||||
position: absolute;
|
||||
top: -13rpx;
|
||||
right: -8rpx;
|
||||
height: 25rpx;
|
||||
min-width: 25rpx;
|
||||
padding: 4rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 20rpx;
|
||||
background: linear-gradient(180deg, #FC4133, #FF7A04);
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.my-assets {
|
||||
margin: 0 20rpx;
|
||||
padding: 30rpx;
|
||||
padding-top: 0;
|
||||
background: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.my-assets .item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.my-wallet {
|
||||
position: relative;
|
||||
width: 200rpx;
|
||||
border-left: 1px solid #dddddd;
|
||||
}
|
||||
|
||||
.my-wallet::after {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: '';
|
||||
left: 0;
|
||||
border: 8rpx solid transparent;
|
||||
border-left-color: #dddddd;
|
||||
}
|
||||
|
||||
.menu-wrap {
|
||||
margin: 0 20rpx;
|
||||
margin-top: 30rpx;
|
||||
background: #ffffff;
|
||||
/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
|
||||
border-radius: 12rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.menu-wrap .group-bd {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.menu-wrap .item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 142rpx;
|
||||
height: 150rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.menu-wrap .icon-round {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.menu-wrap .item .iconfont {
|
||||
font-size: 40rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.menu-wrap .item .name {
|
||||
margin-top: 19rpx;
|
||||
}
|
||||
|
||||
.bind_phone {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.bind_content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #ffffff;
|
||||
/* box-shadow: 0 0 6rpx 0 rgba(0, 0, 0, 0.1); */
|
||||
border-radius: 16rpx;
|
||||
height: 100%;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.bind_txt {}
|
||||
|
||||
.bind_btn {
|
||||
width: 134rpx;
|
||||
height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 25rpx;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background-color: $dominant-color;
|
||||
}
|
||||
|
||||
.vertical {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 53px;
|
||||
z-index: 100000;
|
||||
}
|
||||
|
||||
.vertical_img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
.f20 {
|
||||
margin-left: 5rpx;
|
||||
font-size: 19rpx;
|
||||
}
|
||||
|
||||
.red_mini {
|
||||
color: #333333;
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.icon-zhuanshutequan {
|
||||
color: #f5dca6;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
.news {
|
||||
position: absolute;
|
||||
top: 40rpx;
|
||||
right: 20rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.news .chat {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.news .icon-xiaoxi {
|
||||
font-size: 50rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.news_num {
|
||||
position: absolute;
|
||||
top: 24rpx;
|
||||
right: 44rpx;
|
||||
z-index: 100;
|
||||
border-radius: 50%;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
text-align: center;
|
||||
line-height: 25rpx;
|
||||
color: #FFFFFF;
|
||||
background-color: #ff6633;
|
||||
padding: 5rpx;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.activity_img {}
|
||||
|
||||
.activity_img image {
|
||||
width: 710rpx;
|
||||
height: 302rpx;
|
||||
margin: 0 auto;
|
||||
margin-top: 15rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.my-assets-all {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
|
||||
.my-assets-all .icon.icon-jiantou {
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
596
pages/user/invite/invite.vue
Normal file
596
pages/user/invite/invite.vue
Normal file
@ -0,0 +1,596 @@
|
||||
<template>
|
||||
<view class="invite-wrap" v-if="!loadding" style="background: linear-gradient(180deg, #FED1A7, #FCDBD4);">
|
||||
<view class="rule">
|
||||
<button class="rule_btn" @click="isPopup=true">活动规则</button>
|
||||
<button class="rule_btn" @click="ReLaunch()">返回首页</button>
|
||||
</view>
|
||||
<view class="banner">
|
||||
<image :src="detail.file_path" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="invite-content">
|
||||
<view class="tab d-c-c">
|
||||
<view class="item flex-1 d-c-c d-c" :class="tab_active==0?'active':''" @click="tab_active=0">
|
||||
<text class="">领取大礼包</text>
|
||||
<text class="f18">火热进行中</text>
|
||||
</view>
|
||||
<view class="item flex-1 d-c-c d-c" :class="tab_active==1?'active':''" @click="tab_active=1">
|
||||
<text class="">我的奖励</text>
|
||||
<text class="f18">多邀多得</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="invite-inner">
|
||||
<!--type 1-->
|
||||
<view class="invite-type" v-if="tab_active==0">
|
||||
<view class="content">
|
||||
<view class="image" >
|
||||
<image src="/static/invite/bg-invite.jpg" mode=""></image>
|
||||
</view>
|
||||
<view class="list d-a-c">
|
||||
<view class="item flex-1 d-c-c d-c"
|
||||
:class="detail.count>=item.invitation_num?'select-item':''"
|
||||
v-for="(item,index) in detail.Reward" :key="index">
|
||||
<text class="invite-num">{{item.invitation_num}}人</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="state-explan d-c-c" v-if="!detail.is_over">
|
||||
已邀请{{detail.count}}人,还差<text class="p-0-10"
|
||||
style="color: #FF5649;">{{detail.dif}}</text>人就可以领取礼包啦
|
||||
</view>
|
||||
<view class="state-explan d-c-c" v-if="detail.is_over">
|
||||
共邀请<text style="color: #FF5649;">{{detail.count}}</text>人,奖品已全部领取,感谢您的参与
|
||||
</view>
|
||||
<view class="title" v-if="detail.inv_condition==0">
|
||||
注:邀请好友注册即邀请成功
|
||||
</view>
|
||||
<view class="title" v-if="detail.inv_condition==1">
|
||||
注:邀请好友注册且好友消费即邀请成功
|
||||
</view>
|
||||
<view class="btns-box">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<button open-type="share">邀请好友得礼包</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<button @click="showShare">邀请好友得礼包</button>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!--type 2-->
|
||||
<view class="invite-type2" v-if="tab_active==1">
|
||||
<view class="list" v-for="(item,index) in detail.prize" :key="index">
|
||||
<view class="item p-20-0 d-b-c" v-if="item.coupon_name!=''">
|
||||
<view class="d-s-s d-c">
|
||||
<view class="d-s-c">
|
||||
<image style="width: 36rpx;height: 36rpx;" src="/static/invite/invite-coupon.jpg" mode=""></image>
|
||||
<text class="f22 ml10 gray9">{{item.coupon_name}}</text>
|
||||
</view>
|
||||
<text class="gray9 f18">{{item.create_time}}</text>
|
||||
</view>
|
||||
<text class="f22" style="color: #06727F;">优惠券</text>
|
||||
</view>
|
||||
<view class="item p-20-0 d-b-c" v-if="item.point!=0">
|
||||
<view class="d-s-s d-c">
|
||||
<view class="d-s-c">
|
||||
<image style="width: 36rpx;height: 36rpx;" src="/static/invite/invite-points.jpg" mode=""></image>
|
||||
<text class="f22 ml10 gray9">+{{item.point}}</text>
|
||||
</view>
|
||||
<text class="gray9 f18">{{item.create_time}}</text>
|
||||
</view>
|
||||
<text class="f22" style="color: #06727F;">积分</text>
|
||||
</view>
|
||||
<view class="item p-20-0 d-b-c" v-if="item.balance!=0">
|
||||
<view class="d-s-s d-c">
|
||||
<view class="d-s-c">
|
||||
<image style="width: 36rpx;height: 36rpx;" src="/static/invite/invite-points.jpg" mode=""></image>
|
||||
<text class="f22 ml10 gray9">+{{item.balance}}</text>
|
||||
</view>
|
||||
<text class="gray9 f18">{{item.create_time}}</text>
|
||||
</view>
|
||||
<text class="f22" style="color: #06727F;">余额</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-c-c p30" v-if="detail.prize.length==0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--底部弹窗-->
|
||||
<MpShare :isMpShare="isMpShare" @close="closeShare"></MpShare>
|
||||
<!--app分享-->
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<AppShare :isAppShare="isAppShare" :appParams="appParams" @close="closeShare"></AppShare>
|
||||
<!-- #endif -->
|
||||
<Popup :show="isPopup" :width="575" :heigth="550" :padding="0" @hidePopup="hidePopupFunc" backgroundColor="none">
|
||||
<view class="pop-center">
|
||||
<image class="bg-rule" src="/static/invite/bg-rule.png" mode=""></image>
|
||||
<view class="pop-title">活动规则</view>
|
||||
<scroll-view scroll-y="true" style="height: 473rpx;">
|
||||
<view class="scroll-box">
|
||||
<view class="f26 fb mb22">活动时间:</view>
|
||||
<view class="f22 gray6 mb35">{{detail.start_time.text+"--"+detail.end_time.text}}</view>
|
||||
<view class="f26 fb mb22">活动奖励:</view>
|
||||
<view class="reward_items" v-for="(item,index) in detail.Reward" :key="index">
|
||||
<view class="d-s-c" style="color: #06727F;">
|
||||
<image class="invite-user" src="/static/invite/invite-user.jpg" mode=""></image>
|
||||
邀请<text style="color:#FF5649;">{{item.invitation_num}}</text>人后奖励
|
||||
</view>
|
||||
<view class="d-s-c">
|
||||
<template v-if="item.coupon_name!=''">
|
||||
<view class="reward_item ">
|
||||
<image style="width: 72rpx;height: 72rpx;"
|
||||
src="/static/invite/invite-coupon.jpg" mode=""></image>
|
||||
<view class="f22 gray9">{{item.coupon_name}}</view>
|
||||
</view>
|
||||
<view class="f22 gray9 m-0-20" v-if="item.point!=0&&item.balance!=0">+</view>
|
||||
</template>
|
||||
<template v-if="item.point!=0">
|
||||
<view class="reward_item ">
|
||||
<image style="width: 72rpx;height: 72rpx;"
|
||||
src="/static/invite/invite-points.jpg" mode=""></image>
|
||||
<text class="f22 gray9">{{item.point}}{{points_name()}}</text>
|
||||
</view>
|
||||
<view class="f22 gray9 m-0-20" v-if="item.balance!=0">+</view>
|
||||
</template>
|
||||
<view v-if="item.balance!=0" class="reward_item">
|
||||
<image style="width: 72rpx;height: 72rpx;" src="/static/invite/invite-points.jpg"
|
||||
mode=""></image>
|
||||
<text class="f22 gray9">{{item.balance}}余额</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</Popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Popup from '@/components/uni-popup.vue';
|
||||
import AppShare from '@/components/app-share.vue';
|
||||
import MpShare from '@/components/mp-share.vue';
|
||||
export default {
|
||||
components: {
|
||||
Popup,
|
||||
AppShare,
|
||||
MpShare
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*是否加载完成*/
|
||||
loadding: false,
|
||||
invitation_gift_id: 0,
|
||||
/*弹窗是否打开*/
|
||||
isPopup: false,
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
tab_active: 0,
|
||||
/*活动详情*/
|
||||
detail: {
|
||||
start_time: {
|
||||
text: 0
|
||||
},
|
||||
end_time: {
|
||||
text: 0
|
||||
},
|
||||
dif: 0,
|
||||
count: 0
|
||||
},
|
||||
url: '',
|
||||
/*app分享*/
|
||||
isAppShare: false,
|
||||
appParams: {
|
||||
title: '',
|
||||
summary: '',
|
||||
path: ''
|
||||
},
|
||||
/*公众号分享*/
|
||||
isMpShare: false
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
this.invitation_gift_id = e.invitation_gift_id;
|
||||
//#ifdef H5
|
||||
this.url = window.location.href;
|
||||
//#endif
|
||||
|
||||
},
|
||||
onShow() {
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
self._get('plus.invitationgift.invitation/getDatas', {
|
||||
invitation_gift_id: self.invitation_gift_id || 0,
|
||||
url: self.url
|
||||
}, function(res) {
|
||||
self.detail = res.data.data;
|
||||
// 配置微信分享参数
|
||||
//#ifdef H5
|
||||
if (self.url != '') {
|
||||
let params = {
|
||||
invitation_id: self.invitation_gift_id,
|
||||
referee_id: self.getUserId()
|
||||
};
|
||||
self.configWx(res.data.share.signPackage, res.data.share.shareParams, params);
|
||||
}
|
||||
//#endif
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
}, (err) => {
|
||||
uni.navigateBack()
|
||||
});
|
||||
},
|
||||
/*分享*/
|
||||
onShareAppMessage() {
|
||||
let self = this;
|
||||
// 构建页面参数
|
||||
let params = self.getShareUrlParams({
|
||||
invitation_id: self.invitation_gift_id,
|
||||
referee_id: self.getUserId()
|
||||
});
|
||||
return {
|
||||
title: self.detail.share_title,
|
||||
path: '/pages/index/index?' + params,
|
||||
imageUrl: self.detail.share.file_path
|
||||
};
|
||||
},
|
||||
/* 返回首页 */
|
||||
ReLaunch() {
|
||||
this.gotoPage('/pages/index/index', 'reLaunch');
|
||||
},
|
||||
//关闭活动规则
|
||||
hidePopupFunc() {
|
||||
this.isPopup = false;
|
||||
},
|
||||
/*领奖*/
|
||||
getPrize(e) {
|
||||
let self = this;
|
||||
self._post('user.invitation/getPrize', {
|
||||
invitation_reward_id: e,
|
||||
invitation_gift_id: self.detail.invitation_gift_id,
|
||||
}, function(res) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '领取成功',
|
||||
duration: 2000,
|
||||
icon: 'success'
|
||||
});
|
||||
self.getData();
|
||||
});
|
||||
},
|
||||
showShare() {
|
||||
let self = this;
|
||||
//#ifndef APP-PLUS
|
||||
self.isMpShare = true;
|
||||
//#endif
|
||||
//#ifdef APP-PLUS
|
||||
self.appParams.title = self.detail.share_title;
|
||||
self.appParams.summary = self.detail.share_desc;
|
||||
// 构建页面参数
|
||||
let params = self.getShareUrlParams({
|
||||
invitation_id: self.invitation_gift_id,
|
||||
referee_id: self.getUserId()
|
||||
});
|
||||
self.appParams.path = '/pages/index/index?' + params;
|
||||
self.appParams.image = self.detail.share.file_path;
|
||||
self.isAppShare = true;
|
||||
//#endif
|
||||
},
|
||||
//关闭分享
|
||||
closeShare(data) {
|
||||
this.isAppShare = false;
|
||||
this.isMpShare = false;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.invite-wrap {
|
||||
min-height: 100vh;
|
||||
background: none;
|
||||
position: relative;
|
||||
padding-top: 372rpx;
|
||||
padding-bottom: 60rpx;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.banner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.invite-wrap .banner image {
|
||||
width: 750rpx;
|
||||
}
|
||||
|
||||
.invite-wrap .activity-date {
|
||||
width: 500rpx;
|
||||
height: 40rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 20rpx;
|
||||
background: #ff5b90;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.invite-content {
|
||||
margin: 50rpx;
|
||||
margin-top: 0;
|
||||
border-radius: 25rpx;
|
||||
background: #FFFFFF;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.invite-content .tab {
|
||||
/* border-bottom: 1px solid #CCCCCC; */
|
||||
border-top-left-radius: 15rpx;
|
||||
border-top-right-radius: 15rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.invite-content .tab .item {
|
||||
height: 84rpx;
|
||||
font-size: 28rpx;
|
||||
background: #F88E75;
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.invite-content .tab .item.active {
|
||||
color: #ffffff;
|
||||
box-shadow: none;
|
||||
background-color: #FF5649;
|
||||
}
|
||||
|
||||
|
||||
.invite-content .tab .item .headtext {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.invite-content .invite-inner {
|
||||
padding:0 50rpx 70rpx 50rpx;
|
||||
}
|
||||
|
||||
.invite-content .invite-type .title {
|
||||
text-align: center;
|
||||
color: #7F675B;
|
||||
font-size: 24rpx;
|
||||
height: 87rpx;
|
||||
line-height: 87rpx;
|
||||
border-top: 1rpx dashed #7F675B;
|
||||
}
|
||||
|
||||
.state-explan {
|
||||
font-size: 24rpx;
|
||||
color: #06727F;
|
||||
text-align: center;
|
||||
padding: 40rpx 0;
|
||||
}
|
||||
|
||||
.invite-content .invite-type .content {
|
||||
margin-top: 40rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.invite-content .invite-type .content .image {
|
||||
width: 358rpx;
|
||||
height: 255rpx;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 20rpx;
|
||||
image{
|
||||
width: 358rpx;
|
||||
height: 255rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.invite-content .invite-type .list {
|
||||
width: 414rpx;
|
||||
margin: 0 auto;
|
||||
border-radius: 25rpx;
|
||||
background-color: #ffdbcb;
|
||||
}
|
||||
|
||||
.invite-content .invite-type .list .item {
|
||||
background-color: #ffdbcb;
|
||||
border-radius: 25rpx;
|
||||
height: 8rpx;
|
||||
}
|
||||
.invite-content .invite-type .list .item .invite-num{
|
||||
display: none;
|
||||
}
|
||||
.select-item {
|
||||
position: relative;
|
||||
height: 8rpx;
|
||||
background-color: #FF5649;
|
||||
}
|
||||
.select-item:first-child{
|
||||
border-top-left-radius: 25rpx;
|
||||
border-bottom-left-radius: 25rpx;
|
||||
}
|
||||
.select-item:last-child {
|
||||
border-top-right-radius: 25rpx;
|
||||
border-bottom-right-radius: 25rpx;
|
||||
}
|
||||
|
||||
.select-item .invite-num {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
bottom: -18rpx;
|
||||
color: #7F675B;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
|
||||
.invite-content .invite-type2 .item {
|
||||
border-bottom: 1px dashed #CCCCCC;
|
||||
}
|
||||
|
||||
.invite-content .invite-type2 .item .num {
|
||||
color: #f62c6d;
|
||||
}
|
||||
|
||||
.invite-content .btns-box {
|
||||
margin-top: 45rpx;
|
||||
}
|
||||
|
||||
.invite-content .btns-box button {
|
||||
margin: 0 auto;
|
||||
width: 312rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
border-radius: 35rpx;
|
||||
text-align: center;
|
||||
background: #FF5649;
|
||||
font-size: 30rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 15rpx;
|
||||
width: 100%;
|
||||
background-color: #f7d887;
|
||||
margin-top: 32rpx;
|
||||
margin-bottom: 27rpx;
|
||||
}
|
||||
|
||||
.progress .progress_dot {
|
||||
width: 15rpx;
|
||||
height: 15rpx;
|
||||
background-color: #f88035;
|
||||
border-radius: 50%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.invite_rule {}
|
||||
|
||||
.invite_rule .title {
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
font-size: 31rpx;
|
||||
line-height: 50rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.rule_list {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
padding: 0 50rpx;
|
||||
}
|
||||
|
||||
.rule_item {
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
border-radius: 8rpx;
|
||||
background-color: #FFFFFF20;
|
||||
text-align: center;
|
||||
line-height: 128rpx;
|
||||
}
|
||||
|
||||
.rule_list .rule_item .icon {
|
||||
font-size: 88rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.oblique {
|
||||
color: #f3de8d;
|
||||
font-weight: 900;
|
||||
margin: 0 30rpx;
|
||||
}
|
||||
|
||||
.rule {
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 35rpx;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.rule_btn {
|
||||
margin-bottom: 27rpx;
|
||||
width: 131rpx;
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
text-align: center;
|
||||
background: #FF5649;
|
||||
border-right: none;
|
||||
border-top-left-radius: 22rpx;
|
||||
border-bottom-left-radius: 22rpx;
|
||||
color: #ffffff;
|
||||
font-size: 22rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.reward_items {
|
||||
padding: 32rpx 0 40rpx 0;
|
||||
border-top: 1px dashed #eeeeee;
|
||||
border-bottom: 1px dashed #eeeeee;
|
||||
}
|
||||
|
||||
.reward_item {
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.reward_time {
|
||||
border-bottom: 1px dashed #CCCCCC;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.pop-center {
|
||||
position: relative;
|
||||
width: 575rpx;
|
||||
height: 550rpx;
|
||||
}
|
||||
|
||||
.pop-title {
|
||||
position: relative;
|
||||
height: 77rpx;
|
||||
line-height: 77rpx;
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
text-align: center;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.bg-rule {
|
||||
width: 575rpx;
|
||||
height: 550rpx;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.scroll-box {
|
||||
color: #7F685A;
|
||||
padding: 64rpx 50rpx 60rpx 43rpx;
|
||||
}
|
||||
|
||||
.invite-user {
|
||||
margin-right: 9rpx;
|
||||
flex-shrink: 0;
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
</style>
|
||||
233
pages/user/modify-phone/modify-phone.vue
Normal file
233
pages/user/modify-phone/modify-phone.vue
Normal file
@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<view class="login-container">
|
||||
<view class="p30">
|
||||
<view class="group-bd">
|
||||
<view class="form-level d-s-c">
|
||||
<view class="d-s-c field-name">
|
||||
<text class="orange">*</text>
|
||||
<text class="gray3">手机号:</text>
|
||||
</view>
|
||||
<view class="val flex-1"><input type="text" v-model="formData.mobile" placeholder="请输入要绑定的新手机号" :disabled="is_send" /></view>
|
||||
</view>
|
||||
<view class="form-level d-s-c">
|
||||
<view class="d-s-c field-name">
|
||||
<text class="orange">*</text>
|
||||
<text class="gray3">验证码:</text>
|
||||
</view>
|
||||
<view class="val flex-1 d-b-c">
|
||||
<input class="flex-1" type="number" v-model="formData.code" placeholder="请输入验证码" />
|
||||
<button class="get-code-btn" type="default" @click="sendCode" :disabled="is_send">{{ send_btn_txt }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btns p30"><button type="default" @click="formSubmit">提交</button></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
/*表单数据对象*/
|
||||
formData: {
|
||||
/*手机号*/
|
||||
mobile: '',
|
||||
/*验证码*/
|
||||
code: '',
|
||||
},
|
||||
/*是否已发验证码*/
|
||||
is_send: false,
|
||||
/*发送按钮文本*/
|
||||
send_btn_txt: '获取验证码',
|
||||
/*当前秒数*/
|
||||
second: 60,
|
||||
ip: '',
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
/*提交*/
|
||||
formSubmit() {
|
||||
let self = this;
|
||||
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
|
||||
uni.showToast({
|
||||
title: '手机有误,请重填!',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.formData.code == '') {
|
||||
uni.showToast({
|
||||
title: '验证码不能为空!',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '正在提交'
|
||||
});
|
||||
uni.navigateBack();
|
||||
self._post(
|
||||
'user.userweb/bindMobile',
|
||||
self.formData,
|
||||
result => {
|
||||
uni.showToast({
|
||||
title: '绑定成功',
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(function(){
|
||||
// 执行回调函数
|
||||
uni.navigateBack();
|
||||
}, 2000);
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/*发送短信*/
|
||||
sendCode() {
|
||||
let self = this;
|
||||
|
||||
if (!/^1(3|4|5|6|7|8|9)\d{9}$/.test(self.formData.mobile)) {
|
||||
uni.showToast({
|
||||
title: '手机有误,请重填!',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
self._post(
|
||||
'user.userweb/sendCode',
|
||||
{
|
||||
mobile: self.formData.mobile
|
||||
},
|
||||
result => {
|
||||
if (result.code == 1) {
|
||||
uni.showToast({
|
||||
title: '发送成功'
|
||||
});
|
||||
self.is_send = true;
|
||||
self.changeMsg();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/*改变发送验证码按钮文本*/
|
||||
changeMsg() {
|
||||
if (this.second > 0) {
|
||||
this.send_btn_txt = this.second + '秒';
|
||||
this.second--;
|
||||
setTimeout(this.changeMsg, 1000);
|
||||
} else {
|
||||
this.send_btn_txt = '获取验证码';
|
||||
this.second = 60;
|
||||
this.is_send = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.login-container {
|
||||
background: #ffffff;
|
||||
}
|
||||
.login-container input {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
}
|
||||
.wechatapp {
|
||||
padding: 80rpx 0 48rpx;
|
||||
border-bottom: 1rpx solid #e3e3e3;
|
||||
margin-bottom: 72rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wechatapp .header {
|
||||
width: 190rpx;
|
||||
height: 190rpx;
|
||||
border: 2px solid #fff;
|
||||
margin: 0rpx auto 0;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
box-shadow: 1px 0px 5px rgba(50, 50, 50, 0.3);
|
||||
}
|
||||
|
||||
.auth-title {
|
||||
color: #585858;
|
||||
font-size: 34rpx;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.auth-subtitle {
|
||||
color: #888;
|
||||
margin-bottom: 88rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.login-btn {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.login-btn button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: #04be01;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
border-radius: 999rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.no-login-btn {
|
||||
margin-top: 20rpx;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.no-login-btn button {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background: #dfdfdf;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
border-radius: 999rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.get-code-btn {
|
||||
width: 200rpx;
|
||||
height: 80rpx;
|
||||
line-height: 76rpx;
|
||||
padding: 0rpx 30rpx;
|
||||
border-radius: 40rpx;
|
||||
white-space: nowrap;
|
||||
border: 1rpx solid $dominant-color;
|
||||
color: $dominant-color;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.get-code-btn[disabled='true'] {
|
||||
border: 1rpx solid #cccccc;
|
||||
}
|
||||
|
||||
.btns button {
|
||||
height: 90rpx;
|
||||
line-height: 90rpx;
|
||||
font-size: 34rpx;
|
||||
border-radius: 45rpx;
|
||||
background: $dominant-color;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
422
pages/user/my-bargain/my-bargain.vue
Normal file
422
pages/user/my-bargain/my-bargain.vue
Normal file
@ -0,0 +1,422 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- #ifdef MP-WEIXIN || APP-PLUS -->
|
||||
<view class="ww100" :style="'height:'+topBarTop()+'px;'" style="background-color: #5508BE;"></view>
|
||||
<view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'" style="background-color: #5508BE;">
|
||||
<view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view>
|
||||
<view class="fb">我的砍价</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="top-tabbar">
|
||||
<view :class="status == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc(0)">进行中</view>
|
||||
<view :class="status == 1 ? 'tab-item active' : 'tab-item'" @click="stateFunc(1)">砍价成功</view>
|
||||
<view :class="status == 2 ? 'tab-item active' : 'tab-item'" @click="stateFunc(2)">砍价失败</view>
|
||||
</view>
|
||||
|
||||
<!--列表-->
|
||||
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
|
||||
@scrolltolower="scrolltolowerFunc">
|
||||
<view class="my-bargaing-list">
|
||||
<view class="item" @click="gotoDetail(item.bargain_task_id)" v-for="(item, index) in listData" :key="index">
|
||||
<!--时间-->
|
||||
<view class="datetime d-b-c">
|
||||
<text class="f28">{{ item.create_time }}</text>
|
||||
<view class="surplus-time" v-if="status == 0">
|
||||
<Countdown :config="rturnObjec(item)"></Countdown>
|
||||
</view>
|
||||
</view>
|
||||
<!--商品-->
|
||||
<view class="product d-s-s mt30">
|
||||
<view class="cover">
|
||||
<image :src="item.file_path" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="info flex-1 ml20 f28">
|
||||
<text class="f26 text-ellipsis-2">{{ item.product_name }}</text>
|
||||
<view class="mt20">
|
||||
<text class="redF6 f26">砍到底价:</text>
|
||||
<text class="redF6 f20">¥</text><text class="redF6 f32">{{ item.bargain_price }}</text>
|
||||
<text class="ml10 gray9 text-l-t f26">{{item.product_price}}</text>
|
||||
</view>
|
||||
<view class="d-b-c mt10 f24">
|
||||
<view><text class="gray3">完成度:</text>
|
||||
<text class="gray3">{{progressReturn(item)}}%</text>
|
||||
</view>
|
||||
<view class="progress-box">
|
||||
<view class="progress-box-active" :style="'width:' + progressReturn(item) + '%;'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--按钮-->
|
||||
</view>
|
||||
<view class="d-c-c p30" v-if="listData.length == 0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!--更多活动-->
|
||||
<view class="more-bargaining"><button type="primary" class="btn-red" @click="gotoMore">更多活动</button></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from '@/components/uni-load-more.vue';
|
||||
import Countdown from '@/components/countdown/countdown.vue';
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore,
|
||||
Countdown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*是否正在加载*/
|
||||
loading: true,
|
||||
/*手机高度*/
|
||||
phoneHeight: 0,
|
||||
/*可滚动视图区域高度*/
|
||||
scrollviewHigh: 0,
|
||||
/*状态选中*/
|
||||
status: 0,
|
||||
/*顶部刷新*/
|
||||
topRefresh: false,
|
||||
/*当前第几页*/
|
||||
page: 1,
|
||||
/*一页多少条*/
|
||||
list_rows: 20,
|
||||
/*数据*/
|
||||
listData: [],
|
||||
/*是否有更多*/
|
||||
no_more: false,
|
||||
/*倒计时配置*/
|
||||
countdownConfig: {
|
||||
/*开始时间*/
|
||||
startstamp: 0,
|
||||
/*结束时间*/
|
||||
endstamp: 0,
|
||||
/*显示类别*/
|
||||
type: 'text',
|
||||
/*文字*/
|
||||
title: '剩余:'
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
/*加载中状态*/
|
||||
loadingType() {
|
||||
if (this.loading) {
|
||||
return 1;
|
||||
} else {
|
||||
if (this.listData.length != 0 && this.no_more) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(e) {},
|
||||
mounted() {
|
||||
this.init();
|
||||
/*获取列表*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*转换参数*/
|
||||
rturnObjec(item) {
|
||||
return {
|
||||
type: 'text',
|
||||
startstamp: 0,
|
||||
endstamp: item.end_time,
|
||||
title: '剩余'
|
||||
};
|
||||
},
|
||||
|
||||
/*返回百分比*/
|
||||
progressReturn(item) {
|
||||
if (item.is_floor == 1) {
|
||||
return 100;
|
||||
} else {
|
||||
return item.bargain_rate;
|
||||
}
|
||||
},
|
||||
|
||||
/*初始化*/
|
||||
init() {
|
||||
let self = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
self.phoneHeight = res.windowHeight;
|
||||
// 计算组件的高度
|
||||
let view = uni.createSelectorQuery().select('.top-tabbar');
|
||||
view.boundingClientRect(data => {
|
||||
let h = self.phoneHeight - data.height;
|
||||
let foot_v = uni.createSelectorQuery().select('.more-bargaining');
|
||||
foot_v
|
||||
.boundingClientRect(data2 => {
|
||||
let h2 = h - data2.height;
|
||||
self.scrollviewHigh = h2;
|
||||
})
|
||||
.exec();
|
||||
}).exec();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*状态切换*/
|
||||
stateFunc(e) {
|
||||
let self = this;
|
||||
if (self.status != e) {
|
||||
self.listData = [];
|
||||
self.page = 1;
|
||||
self.status = e;
|
||||
self.getData();
|
||||
}
|
||||
},
|
||||
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
self.loading = true;
|
||||
self._get(
|
||||
'user.bargain/lists', {
|
||||
page: self.page,
|
||||
list_rows: self.list_rows,
|
||||
status: self.status
|
||||
},
|
||||
function(res) {
|
||||
self.loading = false;
|
||||
self.listData = self.listData.concat(res.data.list.data);
|
||||
self.last_page = res.data.list.last_page;
|
||||
if (res.data.list.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/*可滚动视图区域到底触发*/
|
||||
scrolltolowerFunc() {
|
||||
let self = this;
|
||||
if (self.no_more) {
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
if (self.page <= self.last_page) {
|
||||
self.getData();
|
||||
} else {
|
||||
self.no_more = true;
|
||||
}
|
||||
},
|
||||
|
||||
/*查看详情*/
|
||||
gotoDetail(e) {
|
||||
let url = '/pages/plus/bargain/haggle/haggle?bargain_task_id=' + e;
|
||||
this.gotoPage(url);
|
||||
},
|
||||
goback() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
/*查看更多活动*/
|
||||
gotoMore() {
|
||||
this.gotoPage('/pages/plus/bargain/list/list');
|
||||
},
|
||||
/*倒计时返回状态*/
|
||||
returnValFunc(e, num) {
|
||||
console.log(e, num);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.one-product .pro-info {
|
||||
padding: 0 30rpx;
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.total-count .count {
|
||||
padding-top: 10rpx;
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.product-list .total-count {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.product-list .total-count .left-shadow {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: -24rpx;
|
||||
width: 24rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.product-list .total-count .left-shadow::after {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 24rpx;
|
||||
right: -12rpx;
|
||||
display: block;
|
||||
content: '';
|
||||
background-image: radial-gradient(rgba(0, 0, 0, 0.2) 10%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0) 80%);
|
||||
}
|
||||
|
||||
.buy-checkout {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.buy-checkout .item {
|
||||
min-height: 50rpx;
|
||||
line-height: 50rpx;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.buy-checkout .iconfont.icon-weixin {
|
||||
color: #04be01;
|
||||
font-size: 50rpx;
|
||||
}
|
||||
|
||||
.buy-checkout .iconfont.icon-yue {
|
||||
color: #f0de7c;
|
||||
font-size: 50rpx;
|
||||
}
|
||||
|
||||
.buy-checkout .item.active .iconfont.icon-xuanze {
|
||||
color: #04be01;
|
||||
}
|
||||
|
||||
.my-bargaing-list .item {
|
||||
margin-top: 30rpx;
|
||||
padding: 30rpx;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.my-bargaing-list .surplus-time {
|
||||
padding: 4rpx 16rpx;
|
||||
border-radius: 4rpx;
|
||||
font-size: 26rpx;
|
||||
background: #ffffff;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.my-bargaing-list .cover,
|
||||
.my-bargaing-list .cover image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
}
|
||||
|
||||
.more-bargaining {
|
||||
position: fixed;
|
||||
padding: 20rpx;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.more-bargaining button {
|
||||
font-size: 32rpx;
|
||||
height: 88rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
background: #8D60FF;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.progress-box {
|
||||
width: 50%;
|
||||
height: 8rpx;
|
||||
background: #ECE4FF;
|
||||
border-radius: 4rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-box-active {
|
||||
height: 8rpx;
|
||||
border-radius: 4rpx;
|
||||
background: linear-gradient(90deg, #CEBBFF 0%, #723BFF 100%);
|
||||
}
|
||||
|
||||
.reg180 {
|
||||
padding-right: 20rpx;
|
||||
text-align: right;
|
||||
transform: rotateY(180deg);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.icon-jiantou {
|
||||
color: #FFFFFF;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.head_top {
|
||||
position: relative;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.bg_topimg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
background-color: #5508BE;
|
||||
width: 100%;
|
||||
// height: 320rpx;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.top-tabbar {
|
||||
background-color: #5508BE;
|
||||
border-bottom: none;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-item.active::after {
|
||||
content: '';
|
||||
width: 80rpx;
|
||||
height: 4rpx;
|
||||
background: #E8E8E8;
|
||||
border-radius: 2rpx;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.my-bargaing-list {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
.my-bargaing-list .item {
|
||||
border-radius: 12px;
|
||||
}
|
||||
</style>
|
||||
230
pages/user/my-coupon/my-coupon.vue
Normal file
230
pages/user/my-coupon/my-coupon.vue
Normal file
@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="top-tabbar">
|
||||
<view :class="state_active == 0 ? 'tab-item active' : 'tab-item'" @click="stateFunc(0)">未使用</view>
|
||||
<view :class="state_active == 1 ? 'tab-item active' : 'tab-item'" @click="stateFunc(1)">已使用</view>
|
||||
<view :class="state_active == 2 ? 'tab-item active' : 'tab-item'" @click="stateFunc(2)">已过期</view>
|
||||
</view>
|
||||
|
||||
<!--列表-->
|
||||
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50"
|
||||
@scrolltoupper="scrolltoupperFunc" @scrolltolower="scrolltolowerFunc">
|
||||
<view class="p30 bg-white">
|
||||
<view class="item-wrap mb20" v-for="(item, index) in listData" :key="index">
|
||||
<view
|
||||
:class="item.is_expire==0&&item.is_use==0 ? 'coupon-item coupon-item-'+item.color.text : 'coupon-item coupon-item-gray'">
|
||||
<!--装饰用的小圆-->
|
||||
<view class="circles">
|
||||
<text v-for="(circle, num) in 8" :key="num"></text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view>{{item.coupon_type.text}}</view>
|
||||
</view>
|
||||
<view class="operation d-b-c">
|
||||
<view class="flex-1 coupon-content">
|
||||
<view>
|
||||
<template v-if=" item.coupon_type.value == 10 ">
|
||||
<view class="price">
|
||||
<text class="f40 fb">减{{ item.reduce_price*1 }}元</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="item.coupon_type.value == 20 ">
|
||||
<text class="f40 fb">{{ item.discount }}</text><text>折</text>
|
||||
</template>
|
||||
</view>
|
||||
<view class="f30">{{item.min_price>0?'满'+item.min_price*1+'元可用':'无门槛'}}</view>
|
||||
<view class="f24">
|
||||
有效期:{{item.start_time.text}}至{{item.end_time.text}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="right-box d-c-c">
|
||||
<template v-if="item.state.value>0">
|
||||
<view type="default" v-if="item.apply_range!=10" class="f30"
|
||||
@click.stop="gotoPage('/pages/coupon/detail?coupon_id='+ item.coupon_id+'&apply_range='+item.apply_range)">
|
||||
立即使用
|
||||
</view>
|
||||
<view type="default" v-else class="f30"
|
||||
@click.stop="gotoPage('/pages/index/index')">
|
||||
立即使用
|
||||
</view>
|
||||
</template>
|
||||
<view v-else class="f30">
|
||||
<text>{{item.state.text}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="range_item d-b-c" v-if="item.apply_range == 20"
|
||||
@click.stop="gotoPage('/pages/coupon/detail?coupon_id='+ item.coupon_id+'&apply_range='+item.apply_range)">
|
||||
<view>仅可购买指定部分商品</view>
|
||||
<view><text class="icon iconfont icon-jiantou" style="color: #999999; font-size: 24rpx;"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="range_item d-b-c" v-if="item.apply_range == 30"
|
||||
@click.stop="gotoPage('/pages/coupon/detail?coupon_id='+ item.coupon_id+'&apply_range='+item.apply_range)">
|
||||
<view>仅可购买指定分类商品</view>
|
||||
<view><text class="icon iconfont icon-jiantou" style="color: #999999; font-size: 24rpx;"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-c-c p30" v-if="listData.length == 0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from '@/components/uni-load-more.vue';
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*手机高度*/
|
||||
phoneHeight: 0,
|
||||
/*可滚动视图区域高度*/
|
||||
scrollviewHigh: 0,
|
||||
/*状态选中*/
|
||||
state_active: 0,
|
||||
/*列表*/
|
||||
/*当前第几页*/
|
||||
page: 1,
|
||||
/*一页多少条*/
|
||||
last_page: 0,
|
||||
list_rows: 15,
|
||||
listData: [],
|
||||
no_more: false,
|
||||
loading: false,
|
||||
data_type: 'not_use'
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
/*初始化*/
|
||||
this.init();
|
||||
},
|
||||
onShow() {
|
||||
this.initData()
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
computed: {
|
||||
/*加载中状态*/
|
||||
loadingType() {
|
||||
if (this.loading) {
|
||||
return 1;
|
||||
} else {
|
||||
if (this.listData.length != 0 && this.no_more) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/*初始化*/
|
||||
init() {
|
||||
let self = this;
|
||||
uni.getSystemInfo({
|
||||
success(res) {
|
||||
self.phoneHeight = res.windowHeight;
|
||||
// 计算组件的高度
|
||||
let view = uni.createSelectorQuery().select('.top-tabbar');
|
||||
view.boundingClientRect(data => {
|
||||
let h = self.phoneHeight - data.height;
|
||||
self.scrollviewHigh = h;
|
||||
}).exec();
|
||||
}
|
||||
});
|
||||
},
|
||||
initData() {
|
||||
this.listData = [];
|
||||
this.page = 1;
|
||||
this.no_more = false;
|
||||
},
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
self.loading = true;
|
||||
let data_type = self.data_type;
|
||||
self._get('user.coupon/lists', {
|
||||
page: self.page,
|
||||
list_rows: self.list_rows,
|
||||
data_type: data_type,
|
||||
}, function(res) {
|
||||
self.loading = false;
|
||||
self.listData = self.listData.concat(res.data.list.data);
|
||||
self.last_page = res.data.list.last_page;
|
||||
if (res.data.list.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*可滚动视图区域到底触发*/
|
||||
scrolltolowerFunc() {
|
||||
let self = this;
|
||||
if (self.no_more) {
|
||||
return;
|
||||
}
|
||||
self.page++;
|
||||
if (self.page <= self.last_page) {
|
||||
self.getData();
|
||||
} else {
|
||||
self.no_more = true;
|
||||
}
|
||||
},
|
||||
/*状态切换*/
|
||||
stateFunc(e) {
|
||||
let self = this;
|
||||
if (self.state_active != e) {
|
||||
if (e == 0) {
|
||||
self.data_type = 'not_use';
|
||||
}
|
||||
if (e == 1) {
|
||||
self.data_type = 'is_use';
|
||||
}
|
||||
if (e == 2) {
|
||||
self.data_type = 'is_expire';
|
||||
}
|
||||
self.state_active = e;
|
||||
self.initData();
|
||||
self.getData();
|
||||
}
|
||||
},
|
||||
|
||||
/*可滚动视图区域到顶触发*/
|
||||
scrolltoupperFunc() {
|
||||
console.log('滚动视图区域到顶');
|
||||
},
|
||||
/*查看规则*/
|
||||
lookRule(item) {
|
||||
item.rule = true;
|
||||
},
|
||||
|
||||
/*关闭规则*/
|
||||
closeRule(item) {
|
||||
item.rule = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.range_item {
|
||||
border: 1rpx solid #D9D9D9;
|
||||
border-top: none;
|
||||
padding: 8rpx;
|
||||
border-bottom-left-radius: 10rpx;
|
||||
border-bottom-right-radius: 10rpx;
|
||||
color: #666666;
|
||||
box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
104
pages/user/my-wallet/my-balance.vue
Normal file
104
pages/user/my-wallet/my-balance.vue
Normal file
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<view class="p-0-30 bg-white">
|
||||
<!--列表-->
|
||||
<view class="d-b-c border-b p-30-0" v-for="(item, index) in tableData" :key="index">
|
||||
<view class="d-s-s f-w d-c flex-1">
|
||||
<text class="30">{{ item.scene.text }}</text>
|
||||
<text class="pt10 gray9 f22">{{ item.create_time }}</text>
|
||||
</view>
|
||||
<view class="red" v-if="item.money > 0">+{{ item.money }}元</view>
|
||||
<view class="red" v-else>{{ item.money }}元</view>
|
||||
</view>
|
||||
<!-- 没有记录 -->
|
||||
<view class="d-c-c p30" v-if="tableData.length == 0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from '@/components/uni-load-more.vue';
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
/*是否加载完成*/
|
||||
loading: true,
|
||||
/*顶部刷新*/
|
||||
topRefresh: false,
|
||||
/*手机高度*/
|
||||
phoneHeight: 0,
|
||||
/*可滚动视图区域高度*/
|
||||
scrollviewHigh: 0,
|
||||
/*数据列表*/
|
||||
tableData: [],
|
||||
/*最后一页码数*/
|
||||
last_page: 0,
|
||||
/*当前页面*/
|
||||
page: 1,
|
||||
/*每页条数*/
|
||||
list_rows: 20,
|
||||
no_more: false,
|
||||
type: 'all'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
/*加载中状态*/
|
||||
loadingType() {
|
||||
if (this.loading) {
|
||||
return 1;
|
||||
} else {
|
||||
if (this.tableData.length != 0 && this.no_more) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.type = e.type;
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
onReachBottom() {
|
||||
let self = this;
|
||||
if (self.page < self.last_page) {
|
||||
self.page++;
|
||||
self.getData();
|
||||
}
|
||||
self.no_more = true;
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
let page = self.page;
|
||||
let list_rows = self.list_rows;
|
||||
self.loading = true;
|
||||
self._get(
|
||||
'balance.log/lists', {
|
||||
page: page || 1,
|
||||
list_rows: list_rows,
|
||||
type: self.type
|
||||
},
|
||||
function(data) {
|
||||
self.loading = false;
|
||||
self.tableData = self.tableData.concat(data.data.list.data);
|
||||
self.last_page = data.data.list.last_page;
|
||||
if (data.data.list.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
285
pages/user/my-wallet/my-wallet.vue
Normal file
285
pages/user/my-wallet/my-wallet.vue
Normal file
@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<view class="index">
|
||||
<view class="top_bg" :style="'height:'+(368+topBarHeight()*2+topBarTop()*2)+'rpx;'">
|
||||
<!-- #ifdef MP-WEIXIN || APP-PLUS -->
|
||||
<view class="ww100" :style="'height:'+topBarTop()+'px;'"></view>
|
||||
<view class="tc head_top" :style="topBarHeight() == 0 ? '': 'height:'+topBarHeight()+'px;'">
|
||||
<view class="reg180" @click="goback"><text class="icon iconfont icon-jiantou"></text></view>
|
||||
<view class="fb">我的钱包</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="card-top">
|
||||
<view class="f60 white"><text class="f36">¥</text>{{balance}}</view>
|
||||
<view class="f26 white">账户余额(元) <text v-if="cash_open" class="blue ml20 f22" @click="gotoPage('/pages/user/cash/apply')">提现</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wallet-content">
|
||||
<view class="index-head" v-if="balance_open">
|
||||
<view class="card-bottom">
|
||||
<view class="width-150 font-30 pr flex-1" @click="gotoPay">
|
||||
<view>
|
||||
<image class="wallet_img" src="../../../static/icon/chongzhijiaofei.png" mode=""></image>
|
||||
</view>
|
||||
<view class="f26 gray6">充值</view>
|
||||
<view class="icon iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
<view class="none_line"></view>
|
||||
<view class="width-150 font-30 pr flex-1" @click="gotoList('rechange')">
|
||||
<view>
|
||||
<image class="wallet_img" src="../../../static/icon/chongzhijilu.png" mode=""></image>
|
||||
</view>
|
||||
<view class="f26 gray6">充值记录</view>
|
||||
<view class="icon iconfont icon-jiantou"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="index-body">
|
||||
<view class="body-head">
|
||||
<view class="f30">余额提现明细</view>
|
||||
<view class="f26 gray9" @click="gotoPage('/pages/user/cash/list')">更多明细 <text class="icon iconfont icon-jiantou" style="color: #999999;font-size: 22rpx;"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="index-body">
|
||||
<view class="body-head">
|
||||
<view class="f30">钱包明细</view>
|
||||
<view class="f26 gray9" @click="gotoList('all')">更多明细 <text class="icon iconfont icon-jiantou" style="color: #999999;font-size: 22rpx;"></text></view>
|
||||
</view>
|
||||
<view class="body-item" v-for="(item,index) in dataList" :key="index">
|
||||
<view class="body-item-top">
|
||||
<view class="body-item-top-left f32 ">{{ item.scene.text }}</view>
|
||||
<view class="body-item-top-right f36" v-if="item.money > 0">+{{ item.money }}</view>
|
||||
<view class="body-item-top-right f36" v-else>{{ item.money }}</view>
|
||||
</view>
|
||||
<view class="body-item-bottom">
|
||||
<view class="body-item-bottom-left font-24 gray9">{{ item.create_time }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: [],
|
||||
balance: '',
|
||||
balance_open: 0,
|
||||
cash_open:0
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
self.loading = true;
|
||||
self._get(
|
||||
'balance.log/index', {},
|
||||
function(res) {
|
||||
self.loading = false;
|
||||
self.dataList = res.data.list;
|
||||
self.balance = res.data.balance;
|
||||
self.balance_open = res.data.balance_open;
|
||||
self.cash_open = res.data.cash_open;
|
||||
}
|
||||
);
|
||||
},
|
||||
gotoList(type) {
|
||||
this.gotoPage('/pages/user/my-wallet/my-balance?type=' + type);
|
||||
},
|
||||
goback() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
gotoPay() {
|
||||
this.gotoPage('/pages/order/recharge');
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
page {
|
||||
background: #f2f2f2;
|
||||
}
|
||||
|
||||
.font-color-ccc {
|
||||
color: #CCCCCC;
|
||||
}
|
||||
|
||||
.icon-jiantou::before {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.font-24 {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.font-28 {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.font-32 {
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.font-72 {
|
||||
font-size: 72rpx;
|
||||
}
|
||||
|
||||
.width-150 {
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.index {
|
||||
width: 750rpx;
|
||||
}
|
||||
.wallet-content{
|
||||
margin-top: -93rpx;
|
||||
}
|
||||
.index-head {
|
||||
width: 710rpx;
|
||||
margin: 0 auto;
|
||||
height: 160rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 12rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
|
||||
.bg-image {
|
||||
width: 660rpx;
|
||||
height: 340rpx;
|
||||
background-image: url('../../../static/card.png');
|
||||
background-size: 100% 100%;
|
||||
margin: 0 auto;
|
||||
margin-top: 50rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-top {
|
||||
width: 750rpx;
|
||||
height: 290rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-bottom {
|
||||
/* width: 660rpx; */
|
||||
height: 160rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.index-body {
|
||||
width: 710rpx;
|
||||
/* background-color: rgba(0, 0, 0, 0.1); */
|
||||
background-color: white;
|
||||
margin: 0 auto;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 12rpx;
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.body-head {
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx #f2f2f2 solid;
|
||||
}
|
||||
|
||||
.body-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
height: 126rpx;
|
||||
border-bottom: 1rpx #f2f2f2 solid;
|
||||
}
|
||||
|
||||
.body-item-top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: #333333;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.body-item-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.reg180 {
|
||||
padding-right: 20rpx;
|
||||
text-align: right;
|
||||
transform: rotateY(180deg);
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.icon-jiantou {
|
||||
|
||||
color: #FFFFFF;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.head_top {
|
||||
position: relative;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
color: #FFFFFF;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.bg_topimg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 400rpx;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.top_bg {
|
||||
width: 750rpx;
|
||||
height: 368rpx;
|
||||
background: linear-gradient(180deg, #FF774D 0%, #FF422E 100%);
|
||||
}
|
||||
|
||||
.wallet_img {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 14rpx;
|
||||
}
|
||||
|
||||
.index-head .card-bottom .pr .icon-jiantou {
|
||||
position: absolute;
|
||||
right: 95rpx;
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
top: 24rpx;
|
||||
}
|
||||
|
||||
.none_line {
|
||||
width: 1rpx;
|
||||
height: 80rpx;
|
||||
background-color: #D9D9D9;
|
||||
}
|
||||
|
||||
.body-item-top-right {
|
||||
margin-bottom: -30rpx;
|
||||
}
|
||||
</style>
|
||||
248
pages/user/points/part/recharge.vue
Normal file
248
pages/user/points/part/recharge.vue
Normal file
@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<view :class="Visible ? 'pop-bg open' : 'pop-bg close'" @click.stop="closePop(null)">
|
||||
<view class="pop-content" @click.stop>
|
||||
<view class="recharge-top theme-bg mb30">
|
||||
<view class="recharge-icon left"></view>
|
||||
<view class="recharge-icon right"></view>
|
||||
</view>
|
||||
<view class="f30 gray3 ww100 mb35 tc fb">{{points_name()}}提现</view>
|
||||
<view class="input-box"><input type="digit" :placeholder="'请输入兑换'+points_name()+'值'" v-model="value" />
|
||||
<image class="input-err" src="/static/icon/input-err.png" mode="" @click="value = ''"></image>
|
||||
</view>
|
||||
<view class="gray9 f26 tc mt30" style="margin-bottom: 56rpx;">注:1{{points_name()}} = {{discount_ratio}} 余额</view>
|
||||
<view class="ww100 d-c-c">
|
||||
<view class="sub-btn theme-btn" @click="submit()">确认</view>
|
||||
<view class="close-btn theme-borderbtn" @click="closePop(null)">取消</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from "@/components/uni-load-more.vue";
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
input_len: 6,
|
||||
/*是否可见*/
|
||||
Visible: false,
|
||||
value: '',
|
||||
is_send: false,
|
||||
}
|
||||
},
|
||||
props: ['isPop', 'discount_ratio'],
|
||||
watch: {
|
||||
isPop: function(n, o) {
|
||||
let self = this;
|
||||
if (n != o) {
|
||||
self.Visible = n;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submit() {
|
||||
let self = this;
|
||||
if (self.is_send) {
|
||||
return
|
||||
}
|
||||
self.is_send = true;
|
||||
let page = self.page;
|
||||
let list_rows = self.list_rows;
|
||||
self._get('user.User/transPoints', {
|
||||
points: self.value
|
||||
}, function(res) {
|
||||
self.is_send = false;
|
||||
self.showSuccess(res.msg, () => {
|
||||
self.closePop(true);
|
||||
})
|
||||
}, (err) => {
|
||||
self.is_send = false;
|
||||
});
|
||||
},
|
||||
closePop(e) {
|
||||
this.$emit('close', e);
|
||||
this.value = '';
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.recharge-top {
|
||||
height: 75rpx;
|
||||
position: relative;
|
||||
border-radius: 25rpx 25rpx 0 0;
|
||||
.recharge-icon {
|
||||
width: 12rpx;
|
||||
height: 49rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 8rpx 3rpx 0rpx rgba(6, 0, 1, 0.03);
|
||||
border-radius: 6rpx;
|
||||
position: absolute;
|
||||
top: -15rpx;
|
||||
|
||||
}
|
||||
|
||||
.recharge-icon.left {
|
||||
left: 156rpx;
|
||||
}
|
||||
|
||||
.recharge-icon.right {
|
||||
right: 156rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.input-box {
|
||||
width: 428rpx;
|
||||
height: 72rpx;
|
||||
border: 1rpx solid #EEEEEE;
|
||||
border-radius: 15rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 0 14rpx 0 21rpx;
|
||||
margin: 0 auto;
|
||||
|
||||
input {
|
||||
border: none;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.input-err {
|
||||
width: 42rpx;
|
||||
height: 42rpx;
|
||||
flex-shrink: 0;
|
||||
margin-left: 18rpx;
|
||||
}
|
||||
|
||||
.sub-btn {
|
||||
width: 148rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 36rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
margin-right: 93rpx;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
width: 148rpx;
|
||||
height: 48rpx;
|
||||
border-radius: 36rpx;
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.dominant {
|
||||
color: $dominant-color;
|
||||
}
|
||||
|
||||
.pop-bg {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
z-index: 99;
|
||||
|
||||
.pop-content {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin: auto;
|
||||
width: 516rpx;
|
||||
height: 477rpx;
|
||||
padding: 0 0 32rpx 0;
|
||||
box-sizing: border-box;
|
||||
transform: translate3d(0, 0, 0);
|
||||
transition: transform 0.2s cubic-bezier(0, 0, 0.25, 1);
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 25rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.pop-bg.close {
|
||||
// display: none;
|
||||
height: 0;
|
||||
|
||||
.pop-content {
|
||||
transform: translate3d(0, 2000rpx, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.code-image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
|
||||
}
|
||||
|
||||
.icon-img {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 16rpx;
|
||||
|
||||
}
|
||||
|
||||
.close-img {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
position: absolute;
|
||||
right: 32rpx;
|
||||
top: 32rpx;
|
||||
}
|
||||
|
||||
.input-item {
|
||||
width: 72rpx;
|
||||
height: 96rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 0px;
|
||||
font-size: 40rpx;
|
||||
color: rgba(0, 0, 0, 0.87);
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-bottom: 2rpx solid #00BDBD;
|
||||
margin-right: 16rpx;
|
||||
text-align: center;
|
||||
line-height: 96rpx;
|
||||
}
|
||||
|
||||
.input-item:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.input-hid {
|
||||
margin-left: -100%;
|
||||
}
|
||||
|
||||
.get-code-btn {
|
||||
background-color: #FFFFFF;
|
||||
color: $dominant-color;
|
||||
background: none;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
button[disabled]:not([type]).get-code-btn {
|
||||
background-color: #FFFFFF;
|
||||
color: #999999;
|
||||
}
|
||||
</style>
|
||||
186
pages/user/points/points.vue
Normal file
186
pages/user/points/points.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<view :data-theme='theme()' :class="theme() || ''">
|
||||
<view class="points-top theme-bg d-b-c">
|
||||
<image class="bg-points" src="/static/bg-points.png" mode=""></image>
|
||||
<view class="d-c d-c-c pr ww100 hh100">
|
||||
<text class="f28 mb30">{{points_name()}}</text>
|
||||
<text class="f72 fb">{{points}}</text>
|
||||
<text class="f24 re-btn dominant" @click="isPop=true" v-if="is_trans_balance">提现</text>
|
||||
</view>
|
||||
<button v-if="is_open" class="right-btn" @click="gotoShop">{{points_name()}}商城<text class="icon iconfont icon-sanjiao1 ml10" style="color: #ffffff;font-size: 28rpx;"></text></button>
|
||||
</view>
|
||||
<!--列表-->
|
||||
|
||||
<view class="p-0-30 bg-white">
|
||||
<view class="d-b-c border-b p-30-0" v-for="(item, index) in tableData" :key="index">
|
||||
<view class="d-s-s f-w d-c flex-1">
|
||||
<text class="f28">{{points_name(item.describe)}}</text>
|
||||
<text class="pt10 gray9 20">{{item.create_time}}</text>
|
||||
</view>
|
||||
<view class="red f28" v-if="item.value>0">+{{item.value}}</view>
|
||||
<view class="red f28" v-else>{{item.value}}</view>
|
||||
</view>
|
||||
<!-- 没有记录 -->
|
||||
<view class="d-c-c p30" v-if="tableData.length==0 && !loading">
|
||||
<text class="iconfont icon-wushuju"></text>
|
||||
<text class="cont">亲,暂无相关记录哦</text>
|
||||
</view>
|
||||
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
||||
</view>
|
||||
<recharge :isPop="isPop" :discount_ratio="discount_ratio" @close="closePop"></recharge>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniLoadMore from "@/components/uni-load-more.vue";
|
||||
import recharge from "./part/recharge.vue";
|
||||
export default {
|
||||
components: {
|
||||
uniLoadMore,
|
||||
recharge
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isPop: false,
|
||||
/*是否加载完成*/
|
||||
loadding: true,
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
/*顶部刷新*/
|
||||
topRefresh: false,
|
||||
/*手机高度*/
|
||||
phoneHeight: 0,
|
||||
/*可滚动视图区域高度*/
|
||||
scrollviewHigh: 0,
|
||||
/*数据列表*/
|
||||
tableData: [],
|
||||
/*最后一页码数*/
|
||||
last_page: 0,
|
||||
/*当前页面*/
|
||||
page: 1,
|
||||
/*每页条数*/
|
||||
list_rows: 20,
|
||||
no_more: false,
|
||||
loading: true,
|
||||
points: 0,
|
||||
is_open: false,
|
||||
discount_ratio:'0',
|
||||
is_trans_balance:false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
/*加载中状态*/
|
||||
loadingType() {
|
||||
if (this.loading) {
|
||||
return 1;
|
||||
} else {
|
||||
if (this.tableData.length != 0 && this.no_more) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.points_name()
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
/*获取数据*/
|
||||
this.getData();
|
||||
},
|
||||
onReachBottom() {
|
||||
let self = this;
|
||||
if (self.page < self.last_page) {
|
||||
self.page++;
|
||||
self.getData();
|
||||
}
|
||||
self.no_more = true;
|
||||
|
||||
},
|
||||
methods: {
|
||||
closePop(e) {
|
||||
if(e!=null){
|
||||
this.page = 1;
|
||||
this.tableData = [];
|
||||
this.getData();
|
||||
}
|
||||
this.isPop = false;
|
||||
},
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
let page = self.page;
|
||||
let list_rows = self.list_rows;
|
||||
self._get('points.log/index', {
|
||||
page: page || 1,
|
||||
list_rows: list_rows,
|
||||
}, function(data) {
|
||||
self.loading = false;
|
||||
self.points = data.data.points;
|
||||
self.discount_ratio = data.data.discount_ratio;
|
||||
self.is_open = data.data.is_open;
|
||||
self.is_trans_balance = data.data.is_trans_balance*1;
|
||||
self.tableData = self.tableData.concat(data.data.list.data);
|
||||
self.last_page = data.data.list.last_page;
|
||||
if (data.data.list.last_page <= 1) {
|
||||
self.no_more = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
/*跳转积分商城*/
|
||||
gotoShop() {
|
||||
this.gotoPage('/pages/plus/points/list/list');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.points-top {
|
||||
box-sizing: border-box;
|
||||
height: 346rpx;
|
||||
padding: 0 30rpx;
|
||||
color: #FFFFFF;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.bg-points{
|
||||
width: 750rpx;
|
||||
height: 346rpx;
|
||||
z-index: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.re-btn {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
width: 190rpx;
|
||||
padding: 0 8rpx;
|
||||
background-color: #FFFFFF;
|
||||
border-radius: 30rpx;
|
||||
margin-top: 46rpx;
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.right-btn{
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #FFFFFF;
|
||||
position: absolute;
|
||||
right: 21rpx;
|
||||
top: 12rpx;
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
384
pages/user/set/set.vue
Normal file
384
pages/user/set/set.vue
Normal file
@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<view class="address-form" :data-theme="theme()" :class="theme() || ''">
|
||||
<view class="bg-white p-0-30 f30">
|
||||
<view class="d-b-c border-b info-item avatar">
|
||||
<text class="key-name">头像</text>
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<view class="d-e-c" @click="changeAvatarUrl">
|
||||
<view class="info-image"><image :src="userInfo.avatarUrl || '/static/default.png'" mode=""></image></view>
|
||||
<text class="icon iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="d-e-c">
|
||||
<view class="info-image">
|
||||
<button style="padding: 0;" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||
<image :src="userInfo.avatarUrl || '/static/default.png'" mode=""></image>
|
||||
</button>
|
||||
</view>
|
||||
<text class="icon iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="d-b-c p-30-0 border-b">
|
||||
<text class="key-name">会员ID</text>
|
||||
<view class="d-e-c">
|
||||
<text class="mr20">{{ userInfo.user_id }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-b-c p-30-0 border-b">
|
||||
<text class="key-name">昵称</text>
|
||||
<view class="d-e-c" @click="changeName('nickName')">
|
||||
<text class="mr20">{{ userInfo.nickName }}</text>
|
||||
<text class="icon iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-b-c p-30-0">
|
||||
<text class="key-name">手机号码</text>
|
||||
<view class="d-e-c" v-if="userInfo.mobile">
|
||||
<text class="mr20">{{ userInfo.mobile }}</text>
|
||||
</view>
|
||||
<view class="d-e-c" v-if="!userInfo.mobile" @click="gotoBind">
|
||||
<text class="mr20">未绑定</text>
|
||||
<text class="iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="d-b-c p-30-0 border-b">
|
||||
<text class="key-name">当前版本</text>
|
||||
<view class="d-e-c">
|
||||
<text class="mr20">{{ version_no }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-b-c p-30-0 border-b" @click="deleteAccount()">
|
||||
<text class="key-name">删除账号</text>
|
||||
<view class="d-e-c">
|
||||
<text class="icon iconfont icon-jiantou"></text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="setup-btn theme-btn" @tap="logout()">退出登录</view>
|
||||
</view>
|
||||
<!-- 修改资料 -->
|
||||
<Popup :show="isPopup" type="bottom" :width="750" :padding="0" @hidePopup="hidePopupFunc">
|
||||
<form @submit="subName">
|
||||
<view class="d-s-s d-c p20 mpservice-wrap">
|
||||
<view class="tc f32 fb ww100">修改</view>
|
||||
<template v-if="type == 'mobile' || type == 'nickName' || type == 'user_name' || type == 'email' || type == 'idcard'">
|
||||
<view class="pop-input d-b-c">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<input name="newName" :type="type == 'nickName' ? 'nickname' : 'text'" class="flex-1" placeholder="请输入" :value="newName" @input="changeinput" />
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-WEIXIN -->
|
||||
<input type="text" name="newName" class="flex-1" placeholder="请输入" :value="newName" @input="changeinput" />
|
||||
<!-- #endif -->
|
||||
<view class="icon-guanbi icon iconfont" @click="clearName"></view>
|
||||
</view>
|
||||
</template>
|
||||
<view class="d-a-c ww100">
|
||||
<button class="btn-gray-border" @click="hidePopupFunc">取消</button>
|
||||
<button class="theme-btn" form-type="submit">确认</button>
|
||||
</view>
|
||||
</view>
|
||||
</form>
|
||||
</Popup>
|
||||
<!-- 上传头像 -->
|
||||
<Upload v-if="isUpload" :num="1" @getImgs="getImgsFunc"></Upload>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Upload from '@/components/upload/upload.vue';
|
||||
import Popup from '@/components/uni-popup.vue';
|
||||
export default {
|
||||
components: {
|
||||
Upload,
|
||||
Popup
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
userInfo: {},
|
||||
isUpload: false,
|
||||
isPopup: false,
|
||||
newName: '',
|
||||
type: '',
|
||||
version_no: '',
|
||||
imageList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
/*获取个人中心数据*/
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
onChooseAvatar(e) {
|
||||
let self = this;
|
||||
console.log(e);
|
||||
self.uploadFile([e.detail.avatarUrl]);
|
||||
},
|
||||
/*获取数据*/
|
||||
getData() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
self._get('user.index/setting', {}, function(res) {
|
||||
self.userInfo = res.data.userInfo;
|
||||
uni.hideLoading();
|
||||
});
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
|
||||
self.version_no = widgetInfo.version;
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
gotoBind() {
|
||||
this.gotoPage('/pages/user/modify-phone/modify-phone');
|
||||
},
|
||||
logout() {
|
||||
uni.removeStorageSync('token');
|
||||
uni.removeStorageSync('user_id');
|
||||
this.gotoPage('/pages/index/index');
|
||||
},
|
||||
changeName(type) {
|
||||
let self = this;
|
||||
if (type == 'mobile') {
|
||||
self.oldmobile = self.userInfo.mobile;
|
||||
}
|
||||
self.type = type;
|
||||
self.newName = self.userInfo[type];
|
||||
self.isPopup = true;
|
||||
},
|
||||
hidePopupFunc() {
|
||||
this.newName = '';
|
||||
this.isPopup = false;
|
||||
},
|
||||
changeinput(e) {
|
||||
this.newName = e.target.value;
|
||||
},
|
||||
clearName() {
|
||||
this.newName = '';
|
||||
},
|
||||
subName(e) {
|
||||
let self = this;
|
||||
if (self.loading) {
|
||||
return;
|
||||
}
|
||||
self.newName = e.detail.value.newName;
|
||||
console.log(e.detail.value.newName);
|
||||
self.userInfo[self.type] = this.newName;
|
||||
self.update();
|
||||
},
|
||||
/* 修改头像 */
|
||||
changeAvatarUrl() {
|
||||
let self = this;
|
||||
self.isUpload = true;
|
||||
},
|
||||
/*上传图片*/
|
||||
uploadFile: function(tempList) {
|
||||
let self = this;
|
||||
let i = 0;
|
||||
let img_length = tempList.length;
|
||||
let params = {
|
||||
token: uni.getStorageSync('token'),
|
||||
app_id: self.getAppId()
|
||||
};
|
||||
uni.showLoading({
|
||||
title: '图片上传中'
|
||||
});
|
||||
tempList.forEach(function(filePath, fileKey) {
|
||||
uni.uploadFile({
|
||||
url: self.websiteUrl + '/index.php?s=/api/file.upload/image',
|
||||
filePath: filePath,
|
||||
name: 'iFile',
|
||||
formData: params,
|
||||
success: function(res) {
|
||||
let result = typeof res.data === 'object' ? res.data : JSON.parse(res.data);
|
||||
if (result.code === 1) {
|
||||
self.imageList.push(result.data);
|
||||
} else {
|
||||
self.showError(result.msg);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
i++;
|
||||
if (img_length === i) {
|
||||
uni.hideLoading();
|
||||
// 所有文件上传完成
|
||||
self.getImgsFunc(self.imageList);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
/*获取上传的图片*/
|
||||
getImgsFunc(e) {
|
||||
let self = this;
|
||||
self.isUpload = false;
|
||||
if (e && typeof e != 'undefined') {
|
||||
let self = this;
|
||||
self.userInfo.avatarUrl = e[0].file_path;
|
||||
self.update();
|
||||
}
|
||||
},
|
||||
update() {
|
||||
let self = this;
|
||||
if (self.loading) {
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
let params = self.userInfo;
|
||||
self.loading = true;
|
||||
self._post('user.user/updateInfo', params, function(res) {
|
||||
self.showSuccess(
|
||||
'修改成功',
|
||||
function() {
|
||||
self.loading = false;
|
||||
self.isPopup = false;
|
||||
uni.hideLoading();
|
||||
self.getData();
|
||||
},
|
||||
function(err) {
|
||||
uni.hideLoading();
|
||||
self.loading = false;
|
||||
self.isPopup = false;
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
deleteAccount() {
|
||||
let self = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认删除账号?删除后您将无法用此账号登录,此账户下的数据也将删除',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
self._post('user.user/deleteAccount', {}, result => {
|
||||
self.showSuccess('删除成功', () => {
|
||||
uni.removeStorageSync('token');
|
||||
uni.removeStorageSync('user_id');
|
||||
self.gotoPage('/pages/index/index');
|
||||
});
|
||||
}, false, () => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.address-form .key-name {
|
||||
width: 200rpx;
|
||||
}
|
||||
|
||||
.address-form .btn-red {
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
box-shadow: 0 8rpx 16rpx 0 rgba(226, 35, 26, 0.6);
|
||||
}
|
||||
|
||||
.setup-btn {
|
||||
position: fixed;
|
||||
bottom: 20rpx;
|
||||
left: 5%;
|
||||
width: 90%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
// background-color: #fd3826;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.info-item.avatar {
|
||||
height: 162rpx;
|
||||
}
|
||||
|
||||
.info-image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 20rpx;
|
||||
|
||||
image {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.make-item {
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.btn-red.code-btn {
|
||||
height: 54rpx;
|
||||
line-height: 54rpx;
|
||||
}
|
||||
|
||||
.btn-red.code-btn.issend {
|
||||
background: #666666;
|
||||
border: none;
|
||||
color: #ffffff;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.pop-input {
|
||||
width: 100%;
|
||||
margin: 26rpx 0;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 2rpx solid #d9d9d9;
|
||||
}
|
||||
|
||||
.pop-input input {
|
||||
width: 100%;
|
||||
padding-left: 15rpx;
|
||||
|
||||
font-size: 26rpx;
|
||||
color: #333333;
|
||||
margin: 16rpx 0;
|
||||
text-align: left;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
|
||||
.pop-input .icon.icon-guanbi {
|
||||
width: 38rpx;
|
||||
height: 38rpx;
|
||||
background-color: #999999;
|
||||
color: #ffffff;
|
||||
font-size: 22rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.sub-box {
|
||||
padding: 40rpx 0;
|
||||
|
||||
.setup-btn {
|
||||
width: 686rpx;
|
||||
height: 84rpx;
|
||||
background: #e03325;
|
||||
border-radius: 6rpx;
|
||||
line-height: 84rpx;
|
||||
color: #fff;
|
||||
font-size: 30rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
22
pages/user/userinfo/userinfo.vue
Normal file
22
pages/user/userinfo/userinfo.vue
Normal file
@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user