forked from zhongyuanhaiju/uniapp
注释vant的使用
This commit is contained in:
parent
30a0d2979c
commit
9ac15f7f89
|
|
@ -1,3 +1,4 @@
|
||||||
/unpackage
|
/unpackage
|
||||||
/.hbuilderx
|
/.hbuilderx
|
||||||
/.idea
|
/.idea
|
||||||
|
/node_modules/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
export default function uniCopy({content,success,error}) {
|
||||||
|
if(!content) return error('复制的内容不能为空 !')
|
||||||
|
content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
|
||||||
|
/**
|
||||||
|
* 小程序端 和 app端的复制逻辑
|
||||||
|
*/
|
||||||
|
//#ifndef H5
|
||||||
|
uni.setClipboardData({
|
||||||
|
data: content,
|
||||||
|
success: function() {
|
||||||
|
success("复制成功~")
|
||||||
|
console.log('success');
|
||||||
|
},
|
||||||
|
fail:function(){
|
||||||
|
success("复制失败~")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* H5端的复制逻辑
|
||||||
|
*/
|
||||||
|
// #ifdef H5
|
||||||
|
if (!document.queryCommandSupported('copy')) { //为了兼容有些浏览器 queryCommandSupported 的判断
|
||||||
|
// 不支持
|
||||||
|
error('浏览器不支持')
|
||||||
|
}
|
||||||
|
let textarea = document.createElement("textarea")
|
||||||
|
textarea.value = content
|
||||||
|
textarea.readOnly = "readOnly"
|
||||||
|
document.body.appendChild(textarea)
|
||||||
|
textarea.select() // 选择对象
|
||||||
|
textarea.setSelectionRange(0, content.length) //核心
|
||||||
|
let result = document.execCommand("copy") // 执行浏览器复制命令
|
||||||
|
if(result){
|
||||||
|
success("复制成功~")
|
||||||
|
}else{
|
||||||
|
error("复制失败,请检查h5中调用该方法的方式,是不是用户点击的方式调用的,如果不是请改为用户点击的方式触发该方法,因为h5中安全性,不能js直接调用!")
|
||||||
|
}
|
||||||
|
textarea.remove()
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,413 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view @touchmove.prevent.stop>
|
||||||
|
<uni-popup ref="bindMobile" :custom="true" :mask-click="true">
|
||||||
|
<view class="bind-wrap">
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class="head color-base-bg">检测到您还未绑定手机请立即绑定您的手机号</view>
|
||||||
|
<view class="form-wrap">
|
||||||
|
<view class="label">手机号码</view>
|
||||||
|
<view class="form-item"><input type="number" placeholder="请输入您的手机号码" v-model="formData.mobile" /></view>
|
||||||
|
<block v-if="captchaConfig">
|
||||||
|
<view class="label">验证码</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<input type="number" placeholder="请输入验证码" v-model="formData.vercode" />
|
||||||
|
<image :src="captcha.img" class="captcha" @click="getCaptcha"></image>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<view class="label">动态码</view>
|
||||||
|
<view class="form-item">
|
||||||
|
<input type="number" placeholder="请输入动态码" v-model="formData.dynacode" />
|
||||||
|
<view class="send color-base-text" @click="sendMobileCode">{{ dynacodeData.codeText }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="footer">
|
||||||
|
<view @click="cancel">取消</view>
|
||||||
|
<view class="color-base-text" @click="confirm">确定</view>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef MP-WEIXIN || MP-QQ || MP-BAIDU -->
|
||||||
|
<view class="bind-tip-icon"><image :src="$util.img('public/picture/member/login.png')" mode="widthFix"></image></view>
|
||||||
|
<view class="bind-tips">为了方便您接收订单等信息,需要绑定您的手机号码</view>
|
||||||
|
<button open-type="getPhoneNumber" class="auth-login ns-btn-default-all color-base-bg" @getphonenumber="mobileAuthLogin"><text>点击绑定手机号码</text></button>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
<register-reward ref="registerReward"></register-reward>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import uniPopup from '../uni-popup/uni-popup.vue';
|
||||||
|
import validate from 'common/js/validate.js';
|
||||||
|
import registerReward from '../register-reward/register-reward.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'bind-mobile',
|
||||||
|
components: {
|
||||||
|
uniPopup,
|
||||||
|
registerReward
|
||||||
|
},
|
||||||
|
mixins: [validate],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
captchaConfig: 0,
|
||||||
|
captcha: {
|
||||||
|
id: '',
|
||||||
|
img: ''
|
||||||
|
},
|
||||||
|
dynacodeData: {
|
||||||
|
seconds: 120,
|
||||||
|
timer: null,
|
||||||
|
codeText: '获取动态码',
|
||||||
|
isSend: false
|
||||||
|
},
|
||||||
|
formData: {
|
||||||
|
key: '',
|
||||||
|
mobile: '',
|
||||||
|
vercode: '',
|
||||||
|
dynacode: ''
|
||||||
|
},
|
||||||
|
isSub: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCaptchaConfig();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.$refs.bindMobile.open();
|
||||||
|
},
|
||||||
|
cancel() {
|
||||||
|
this.$refs.bindMobile.close();
|
||||||
|
},
|
||||||
|
confirm() {
|
||||||
|
let authData = uni.getStorageSync('authInfo');
|
||||||
|
let data = {
|
||||||
|
mobile: this.formData.mobile,
|
||||||
|
key: this.formData.key,
|
||||||
|
code: this.formData.dynacode
|
||||||
|
};
|
||||||
|
if (this.captcha.id != '') {
|
||||||
|
data.captcha_id = this.captcha.id;
|
||||||
|
data.captcha_code = this.formData.vercode;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (authData) Object.assign(data, authData);
|
||||||
|
if (authData.avatarUrl) data.headimg = authData.avatarUrl;
|
||||||
|
if (authData.nickName) data.nickname = authData.nickName;
|
||||||
|
|
||||||
|
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||||
|
|
||||||
|
if (this.verify(data)) {
|
||||||
|
if (this.isSub) return;
|
||||||
|
this.isSub = true;
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/tripartite/mobile',
|
||||||
|
data,
|
||||||
|
success: res => {
|
||||||
|
if (res.code >= 0) {
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'token',
|
||||||
|
data: res.data.token,
|
||||||
|
success: () => {
|
||||||
|
this.$store.commit('setToken', res.data.token);
|
||||||
|
this.$store.dispatch('getCartNumber');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$refs.bindMobile.close();
|
||||||
|
|
||||||
|
if (res.data.is_register && this.$refs.registerReward.getReward()) {
|
||||||
|
this.$refs.registerReward.open();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.isSub = false;
|
||||||
|
this.getCaptcha();
|
||||||
|
this.$util.showToast({ title: res.message });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
this.isSub = false;
|
||||||
|
this.getCaptcha();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 表单验证
|
||||||
|
* @param {Object} data
|
||||||
|
*/
|
||||||
|
verify(data) {
|
||||||
|
let rule = [{ name: 'mobile', checkType: 'required', errorMsg: '请输入手机号' }, { name: 'mobile', checkType: 'phoneno', errorMsg: '请输入正确的手机号' }];
|
||||||
|
if (this.captchaConfig == 1) {
|
||||||
|
if (this.captcha.id != '') rule.push({ name: 'captcha_code', checkType: 'required', errorMsg: this.$lang('captchaPlaceholder') });
|
||||||
|
}
|
||||||
|
rule.push({ name: 'code', checkType: 'required', errorMsg: this.$lang('dynacodePlaceholder') });
|
||||||
|
|
||||||
|
var checkRes = validate.check(data, rule);
|
||||||
|
if (checkRes) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
this.$util.showToast({ title: validate.error });
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取验证码配置
|
||||||
|
*/
|
||||||
|
getCaptchaConfig() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/config/getCaptchaConfig',
|
||||||
|
success: res => {
|
||||||
|
if (res.code >= 0) {
|
||||||
|
this.captchaConfig = res.data.data.value.shop_reception_login;
|
||||||
|
if (this.captchaConfig) this.getCaptcha();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取验证码
|
||||||
|
*/
|
||||||
|
getCaptcha() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/captcha/captcha',
|
||||||
|
data: {
|
||||||
|
captcha_id: this.captcha.id
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if (res.code >= 0) {
|
||||||
|
this.captcha = res.data;
|
||||||
|
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 发送手机动态码
|
||||||
|
*/
|
||||||
|
sendMobileCode() {
|
||||||
|
if (this.dynacodeData.seconds != 120) return;
|
||||||
|
var data = {
|
||||||
|
mobile: this.formData.mobile,
|
||||||
|
captcha_id: this.captcha.id,
|
||||||
|
captcha_code: this.formData.vercode
|
||||||
|
};
|
||||||
|
var rule = [{ name: 'mobile', checkType: 'required', errorMsg: '请输入手机号' }, { name: 'mobile', checkType: 'phoneno', errorMsg: '请输入正确的手机号' }];
|
||||||
|
if (this.captchaConfig == 1) {
|
||||||
|
rule.push({ name: 'captcha_code', checkType: 'required', errorMsg: '请输入验证码' });
|
||||||
|
}
|
||||||
|
var checkRes = validate.check(data, rule);
|
||||||
|
if (!checkRes) {
|
||||||
|
this.$util.showToast({ title: validate.error });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.dynacodeData.isSend) return;
|
||||||
|
this.dynacodeData.isSend = true;
|
||||||
|
|
||||||
|
if (this.dynacodeData.seconds == 120) {
|
||||||
|
this.dynacodeData.timer = setInterval(() => {
|
||||||
|
this.dynacodeData.seconds--;
|
||||||
|
this.dynacodeData.codeText = this.dynacodeData.seconds + 's后可重新获取';
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/tripartite/mobileCode',
|
||||||
|
data: data,
|
||||||
|
success: res => {
|
||||||
|
this.dynacodeData.isSend = false;
|
||||||
|
if (res.code >= 0) {
|
||||||
|
this.formData.key = res.data.key;
|
||||||
|
} else {
|
||||||
|
this.$util.showToast({ title: res.message });
|
||||||
|
thi.refreshDynacodeData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
this.$util.showToast({ title: 'request:fail' });
|
||||||
|
this.dynacodeData.isSend = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
mobileAuthLogin(e) {
|
||||||
|
if (e.detail.errMsg == 'getPhoneNumber:ok') {
|
||||||
|
let authData = uni.getStorageSync('authInfo');
|
||||||
|
var data = {
|
||||||
|
iv: e.detail.iv,
|
||||||
|
encryptedData: e.detail.encryptedData
|
||||||
|
};
|
||||||
|
if (authData) Object.assign(data, authData);
|
||||||
|
if (authData.avatarUrl) data.headimg = authData.avatarUrl;
|
||||||
|
if (authData.nickName) data.nickname = authData.nickName;
|
||||||
|
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||||
|
|
||||||
|
if (this.isSub) return;
|
||||||
|
this.isSub = true;
|
||||||
|
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/tripartite/mobileauth',
|
||||||
|
data,
|
||||||
|
success: res => {
|
||||||
|
if (res.code >= 0) {
|
||||||
|
uni.setStorage({
|
||||||
|
key: 'token',
|
||||||
|
data: res.data.token,
|
||||||
|
success: () => {
|
||||||
|
this.$store.dispatch('getCartNumber');
|
||||||
|
this.$store.commit('setToken', res.data.token);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.$refs.bindMobile.close();
|
||||||
|
if (res.data.is_register && this.$refs.registerReward.getReward()) {
|
||||||
|
this.$refs.registerReward.open();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.isSub = false;
|
||||||
|
this.$util.showToast({ title: res.message });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
this.isSub = false;
|
||||||
|
this.$util.showToast({ title: 'request:fail' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
refreshDynacodeData() {
|
||||||
|
this.getCaptcha();
|
||||||
|
clearInterval(this.dynacodeData.timer);
|
||||||
|
this.dynacodeData = {
|
||||||
|
seconds: 120,
|
||||||
|
timer: null,
|
||||||
|
codeText: '获取动态码',
|
||||||
|
isSend: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
'dynacodeData.seconds': {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
if (newValue == 0) {
|
||||||
|
this.refreshDynacodeData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.bind-wrap {
|
||||||
|
width: 600rpx;
|
||||||
|
background: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.head {
|
||||||
|
text-align: center;
|
||||||
|
height: 90rpx;
|
||||||
|
line-height: 90rpx;
|
||||||
|
color: #fff;
|
||||||
|
font-size: $font-size-tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-wrap {
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
|
||||||
|
.label {
|
||||||
|
color: #000;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
line-height: 1.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-item {
|
||||||
|
margin: 20rpx 0;
|
||||||
|
display: flex;
|
||||||
|
padding-bottom: 10rpx;
|
||||||
|
border-bottom: 2rpx solid #eee;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
input {
|
||||||
|
font-size: $font-size-tag;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.send {
|
||||||
|
font-size: $font-size-tag;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.captcha {
|
||||||
|
margin: 4rpx;
|
||||||
|
height: 52rpx;
|
||||||
|
width: 140rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
border-top: 2rpx solid #eee;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
view {
|
||||||
|
flex: 1;
|
||||||
|
height: 100rpx;
|
||||||
|
line-height: 100rpx;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
font-size: 28rpx;
|
||||||
|
border-right: 2rpx solid #eee;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.bind-tips {
|
||||||
|
color: #aaa;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
padding: 20rpx 50rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-login {
|
||||||
|
width: calc(100% - 100rpx);
|
||||||
|
margin: 20rpx auto 50rpx auto;
|
||||||
|
height: 80rpx;
|
||||||
|
line-height: 80rpx;
|
||||||
|
border-radius: 80rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bind-tip-icon {
|
||||||
|
padding-top: 80rpx;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 300rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ns-btn-default-all {
|
||||||
|
width: 100%;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 70rpx;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style scoped>
|
||||||
|
/deep/ .reward-popup .uni-popup__wrapper-box {
|
||||||
|
background: none !important;
|
||||||
|
max-width: unset !important;
|
||||||
|
max-height: unset !important;
|
||||||
|
overflow: unset !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,451 @@
|
||||||
|
// 商品详情业务
|
||||||
|
import {
|
||||||
|
Weixin
|
||||||
|
} from '@/common/js/wx-jssdk.js';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
skuId: 0,
|
||||||
|
goodsId:0,
|
||||||
|
isIphoneX: false, //判断手机是否是iphoneX以上
|
||||||
|
whetherCollection: 0,
|
||||||
|
|
||||||
|
//是否开启预览,0:不开启,1:开启
|
||||||
|
preview: 0,
|
||||||
|
token: "",
|
||||||
|
videoContext: '',
|
||||||
|
|
||||||
|
// 媒体,图片,视频
|
||||||
|
|
||||||
|
// 解决每个商品SKU图片数量不同时,无法切换到第一个,导致轮播图显示不出来
|
||||||
|
swiperInterval: 1,
|
||||||
|
swiperAutoplay: false,
|
||||||
|
swiperCurrent: 1,
|
||||||
|
switchMedia: 'img',
|
||||||
|
|
||||||
|
//评价
|
||||||
|
goodsEvaluate: [{
|
||||||
|
member_headimg: '',
|
||||||
|
member_name: '',
|
||||||
|
content: '',
|
||||||
|
images: [],
|
||||||
|
create_time: 0,
|
||||||
|
sku_name: ''
|
||||||
|
}],
|
||||||
|
evaluateConfig: {
|
||||||
|
evaluate_audit: 1,
|
||||||
|
evaluate_show: 0,
|
||||||
|
evaluate_status: 1
|
||||||
|
},
|
||||||
|
|
||||||
|
// 是否可分享到好物圈
|
||||||
|
goodsCircle: false,
|
||||||
|
memberId: 0,
|
||||||
|
service: null,
|
||||||
|
shareUrl: '', // 分享链接
|
||||||
|
source_member: 0, //分享人的id
|
||||||
|
isCommunity: false, //社群弹窗
|
||||||
|
|
||||||
|
poster: "-1", //海报
|
||||||
|
posterMsg: "", //海报错误信息
|
||||||
|
posterHeight: 0,
|
||||||
|
posterParams: {}, //海报所需参数
|
||||||
|
detailTab: 0,
|
||||||
|
goodsRoute:'',
|
||||||
|
posterApi:'',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||||
|
this.token = uni.getStorageSync('token');
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
init(params) {
|
||||||
|
this.skuId = params.sku_id;
|
||||||
|
this.goodsId = params.goods_id;
|
||||||
|
this.preview = params.preview;
|
||||||
|
this.source_member = params.source_member;
|
||||||
|
this.whetherCollection = params.whetherCollection;
|
||||||
|
this.posterParams = params.posterParams;
|
||||||
|
|
||||||
|
this.shareUrl = params.shareUrl;
|
||||||
|
this.memberId = params.memberId;
|
||||||
|
this.goodsRoute = params.goodsRoute;
|
||||||
|
this.posterApi = params.posterApi;
|
||||||
|
this.getService();
|
||||||
|
|
||||||
|
// 评价设置
|
||||||
|
this.getEvaluateConfig();
|
||||||
|
this.videoContext = uni.createVideoContext('goodsVideo');
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.goodsSyncToGoodsCircle();
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
this.getWhetherCollection();
|
||||||
|
},
|
||||||
|
swiperChange(e) {
|
||||||
|
this.swiperCurrent = e.detail.current + 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
//-------------------------------------服务-------------------------------------
|
||||||
|
|
||||||
|
openMerchantsServicePopup() {
|
||||||
|
this.$refs.merchantsServicePopup.open();
|
||||||
|
},
|
||||||
|
closeMerchantsServicePopup() {
|
||||||
|
this.$refs.merchantsServicePopup.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
//-------------------------------------属性-------------------------------------
|
||||||
|
|
||||||
|
openAttributePopup() {
|
||||||
|
this.$refs.attributePopup.open();
|
||||||
|
},
|
||||||
|
closeAttributePopup() {
|
||||||
|
this.$refs.attributePopup.close();
|
||||||
|
},
|
||||||
|
//获取用户是否关注
|
||||||
|
async getWhetherCollection() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: "/api/goodscollect/iscollect",
|
||||||
|
data: {
|
||||||
|
goods_id: this.goodsId
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
this.whetherCollection = res.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//-------------------------------------评价-------------------------------------
|
||||||
|
//商品评论列表
|
||||||
|
getGoodsEvaluate() {
|
||||||
|
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: "/api/goodsevaluate/firstinfo",
|
||||||
|
data: {
|
||||||
|
goods_id: this.goodsSkuDetail.goods_id
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
let data = res.data;
|
||||||
|
if (data) {
|
||||||
|
this.goodsEvaluate = data;
|
||||||
|
this.goodsEvaluate.forEach((item, index) => {
|
||||||
|
if (this.goodsEvaluate[index].images) this.goodsEvaluate[index].images =
|
||||||
|
this.goodsEvaluate[index].images.split(",");
|
||||||
|
if (this.goodsEvaluate[index].is_anonymous == 1) this.goodsEvaluate[
|
||||||
|
index].member_name = this.goodsEvaluate[index].member_name
|
||||||
|
.replace(
|
||||||
|
this.goodsEvaluate[index].member_name.substring(1, this
|
||||||
|
.goodsEvaluate[index].member_name.length - 1), '***')
|
||||||
|
})
|
||||||
|
// if (this.goodsEvaluate.images) this.goodsEvaluate.images = this.goodsEvaluate.images.split(",");
|
||||||
|
// if (this.goodsEvaluate.is_anonymous == 1) this.goodsEvaluate.member_name = this.goodsEvaluate.member_name.replace(
|
||||||
|
// this.goodsEvaluate.member_name.substring(1, this.goodsEvaluate.member_name.length - 1), '***')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 预览评价图片
|
||||||
|
previewEvaluate(index, img_index, field) {
|
||||||
|
var paths = [];
|
||||||
|
for (let i = 0; i < this.goodsEvaluate[index][field].length; i++) {
|
||||||
|
paths.push(this.$util.img(this.goodsEvaluate[index][field][i]));
|
||||||
|
}
|
||||||
|
uni.previewImage({
|
||||||
|
current: img_index,
|
||||||
|
urls: paths
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//-------------------------------------关注-------------------------------------
|
||||||
|
editCollection() {
|
||||||
|
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
||||||
|
|
||||||
|
if (this.token) {
|
||||||
|
|
||||||
|
//未关注添加关注
|
||||||
|
if (this.whetherCollection == 0) {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: "/api/goodscollect/add",
|
||||||
|
data: {
|
||||||
|
sku_id: this.skuId,
|
||||||
|
goods_id: this.goodsSkuDetail.goods_id,
|
||||||
|
sku_name: this.goodsSkuDetail.sku_name,
|
||||||
|
sku_price: this.goodsSkuDetail.show_price,
|
||||||
|
sku_image: this.goodsSkuDetail.sku_image
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
var data = res.data;
|
||||||
|
if (data > 0) {
|
||||||
|
this.whetherCollection = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//已关注取消关注
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: "/api/goodscollect/delete",
|
||||||
|
data: {
|
||||||
|
goods_id: this.goodsSkuDetail.goods_id
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
var data = res.data;
|
||||||
|
if (data > 0) {
|
||||||
|
this.whetherCollection = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.source_member) {
|
||||||
|
this.$refs.login.open(this.shareUrl + '&source_member=' + this.source_member);
|
||||||
|
} else {
|
||||||
|
this.$refs.login.open(this.shareUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
collection() {
|
||||||
|
if (this.preview) return; // 开启预览,禁止任何操作和跳转
|
||||||
|
this.editCollection();
|
||||||
|
if (this.token) {
|
||||||
|
return this.whetherCollection ? 0 : 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//-------------------------------------分享-------------------------------------
|
||||||
|
// 打开分享弹出层
|
||||||
|
openSharePopup() {
|
||||||
|
this.$refs.sharePopup.open();
|
||||||
|
},
|
||||||
|
// 关闭分享弹出层
|
||||||
|
closeSharePopup() {
|
||||||
|
this.$refs.sharePopup.close();
|
||||||
|
},
|
||||||
|
copyUrl() {
|
||||||
|
let text = this.$config.h5Domain + this.shareUrl;
|
||||||
|
if (this.memberId) text += '&source_member=' + this.memberId;
|
||||||
|
this.$util.copy(text, () => {
|
||||||
|
this.closeSharePopup();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//-------------------------------------海报-------------------------------------
|
||||||
|
// 打开海报弹出层
|
||||||
|
openPosterPopup() {
|
||||||
|
this.getGoodsPoster();
|
||||||
|
this.$refs.sharePopup.close();
|
||||||
|
this.$refs.posterPopup.open();
|
||||||
|
if (this.poster != '-1') {
|
||||||
|
setTimeout(() => {
|
||||||
|
let view = uni.createSelectorQuery().in(this).select(".poster-layer .image-wrap");
|
||||||
|
view.fields({
|
||||||
|
size: true,
|
||||||
|
}, data => {
|
||||||
|
let posterWhith = data.width;
|
||||||
|
let ratio = parseFloat((740 / posterWhith).toFixed(2));
|
||||||
|
if (this.token != '') {
|
||||||
|
this.posterHeight = parseInt(1240 / ratio);
|
||||||
|
} else {
|
||||||
|
this.posterHeight = parseInt(1100 / ratio);
|
||||||
|
}
|
||||||
|
}).exec();
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 关闭海报弹出层
|
||||||
|
closePosterPopup() {
|
||||||
|
this.$refs.posterPopup.close();
|
||||||
|
},
|
||||||
|
//生成海报
|
||||||
|
getGoodsPoster() {
|
||||||
|
uni.showLoading({
|
||||||
|
'title' : '海报生成中...'
|
||||||
|
})
|
||||||
|
//活动海报信息
|
||||||
|
if (this.memberId) this.posterParams.source_member = this.memberId;
|
||||||
|
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: this.posterApi,
|
||||||
|
data: {
|
||||||
|
page: this.goodsRoute,
|
||||||
|
qrcode_param: JSON.stringify(this.posterParams)
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.poster = res.data.path + "?time=" + new Date().getTime();
|
||||||
|
} else {
|
||||||
|
this.posterMsg = res.message;
|
||||||
|
}
|
||||||
|
uni.hideLoading();
|
||||||
|
},
|
||||||
|
fail: err => {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 预览图片
|
||||||
|
previewMedia(index) {
|
||||||
|
var paths = [];
|
||||||
|
for (let i = 0; i < this.goodsSkuDetail.sku_images.length; i++) {
|
||||||
|
paths.push(this.$util.img(this.goodsSkuDetail.sku_images[i], {
|
||||||
|
size: 'big'
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
uni.previewImage({
|
||||||
|
current: index,
|
||||||
|
urls: paths,
|
||||||
|
// longPressActions: {
|
||||||
|
// itemList: ['发送给朋友', '保存图片', '关注'],
|
||||||
|
// success: function(data) {
|
||||||
|
// console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
|
||||||
|
// },
|
||||||
|
// fail: function(err) {
|
||||||
|
// console.log(err.errMsg);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
});
|
||||||
|
},
|
||||||
|
swiperImageError(index) {
|
||||||
|
this.goodsSkuDetail.sku_images[index] = this.$util.getDefaultImage().goods;
|
||||||
|
this.$forceUpdate();
|
||||||
|
},
|
||||||
|
// #ifdef MP || APP-PLUS
|
||||||
|
//小程序中保存海报
|
||||||
|
saveGoodsPoster() {
|
||||||
|
let url = this.$util.img(this.poster);
|
||||||
|
uni.downloadFile({
|
||||||
|
url: url,
|
||||||
|
success: (res) => {
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
uni.saveImageToPhotosAlbum({
|
||||||
|
filePath: res.tempFilePath,
|
||||||
|
success: () => {
|
||||||
|
this.$util.showToast({
|
||||||
|
title: "保存成功"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: () => {
|
||||||
|
this.$util.showToast({
|
||||||
|
title: "保存失败,请稍后重试"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
//售后保障查询
|
||||||
|
getService() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/goods/aftersale',
|
||||||
|
success: res => {
|
||||||
|
if (res.code == 0 && res.data) {
|
||||||
|
this.service = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
/**
|
||||||
|
* 将商品同步到微信圈子
|
||||||
|
*/
|
||||||
|
goodsSyncToGoodsCircle() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/goodscircle/api/goods/sync',
|
||||||
|
data: {
|
||||||
|
goods_id: this.goodsSkuDetail.goods_id
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.goodsCircle = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 将商品推荐到微信圈子
|
||||||
|
*/
|
||||||
|
openBusinessView() {
|
||||||
|
if (wx.openBusinessView) {
|
||||||
|
wx.openBusinessView({
|
||||||
|
businessType: 'friendGoodsRecommend',
|
||||||
|
extraData: {
|
||||||
|
product: {
|
||||||
|
item_code: this.goodsSkuDetail.goods_id,
|
||||||
|
title: this.goodsSkuDetail.sku_name,
|
||||||
|
image_list: this.goodsSkuDetail.sku_images.map((ele) => {
|
||||||
|
return this.$util.img(ele);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
success: function(res) {
|
||||||
|
console.log('success', res);
|
||||||
|
},
|
||||||
|
fail: function(res) {
|
||||||
|
console.log('fail', res);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// #endif
|
||||||
|
getEvaluateConfig() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/goodsevaluate/config',
|
||||||
|
success: res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
var data = res.data;
|
||||||
|
this.evaluateConfig = data;
|
||||||
|
if (this.evaluateConfig.evaluate_show == 1) {
|
||||||
|
//商品评论
|
||||||
|
this.getGoodsEvaluate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
toEvaluateDetail(id) {
|
||||||
|
this.$util.redirectTo('/pages_tool/goods/evaluate', {
|
||||||
|
goods_id: id
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showImg(e) {
|
||||||
|
//拿到图片的路径里面的内容放在我们数组中
|
||||||
|
let contentimg = e.target.dataset.nodes;
|
||||||
|
let arrImg = [];
|
||||||
|
for (var i = 0; i < contentimg.length; i++) {
|
||||||
|
var img = contentimg[i].children;
|
||||||
|
if (Array.isArray(img)) {
|
||||||
|
for (var j = 0; j < img.length; j++) {
|
||||||
|
if (img[j].attrs && img[j].name == "img") {
|
||||||
|
if (img[j].attrs.src) {
|
||||||
|
arrImg.push(img[j].attrs.src)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//最后一步就是把我们的所有图片放在预览的api中就可以了
|
||||||
|
uni.previewImage({
|
||||||
|
current: arrImg,
|
||||||
|
urls: arrImg,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
//-------------------------------------社群-------------------------------------
|
||||||
|
|
||||||
|
//添加福利群
|
||||||
|
onCommunity() {
|
||||||
|
this.isCommunity = true
|
||||||
|
},
|
||||||
|
onCloseCommunity() {
|
||||||
|
this.isCommunity = false
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,350 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view scroll-y="true" class="goods-detail" :class="isIphoneX ? 'active' : ''">
|
||||||
|
<view class="goods-container">
|
||||||
|
<!-- 弹幕 -->
|
||||||
|
<pengpai-fadein-out v-if="goodsSkuDetail.barrage_show && goodsSkuDetail.barrageData" ref="pengpai" :duration="1600" :wait="1900" :top="400" :left="0" :radius="60" :loop="true" :info="goodsSkuDetail.barrageData"></pengpai-fadein-out>
|
||||||
|
|
||||||
|
<!-- 商品媒体信息 -->
|
||||||
|
<view class="goods-media">
|
||||||
|
<!-- 商品图片 -->
|
||||||
|
<view class="goods-img" :class="{ show: switchMedia == 'img' }">
|
||||||
|
<swiper class="swiper" @change="swiperChange" :interval="swiperInterval" :autoplay="swiperAutoplay" autoplay="true" interval="4000" circular="true">
|
||||||
|
<swiper-item v-for="(item, index) in goodsSkuDetail.sku_images" :key="index" :item-id="'goods_id_' + index">
|
||||||
|
<view class="item" @click="previewMedia(index)">
|
||||||
|
<image :src="$util.img(item, { size: 'big' })" @error="swiperImageError(index)" mode="aspectFit" />
|
||||||
|
</view>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view class="img-indicator-dots">
|
||||||
|
<text>{{ swiperCurrent }}</text>
|
||||||
|
<text v-if="goodsSkuDetail.sku_images">/{{ goodsSkuDetail.sku_images.length }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品视频 -->
|
||||||
|
<view class="goods-video" :class="{ show: switchMedia == 'video' }">
|
||||||
|
<video id="goodsVideo" :src="$util.img(goodsSkuDetail.video_url)" :poster="$util.img(goodsSkuDetail.sku_image, { size: 'big' })" objectFit="cover"></video>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 切换视频、图片 -->
|
||||||
|
<view class="media-mode" v-if="goodsSkuDetail.video_url != ''">
|
||||||
|
<text :class="{ 'color-base-bg': switchMedia == 'video' }" @click="switchMedia = 'video'">{{ $lang('video') }}</text>
|
||||||
|
<text :class="{ 'color-base-bg': switchMedia == 'img' }" @click="(switchMedia = 'img'), videoContext.pause()">{{ $lang('image') }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 价格区域 -->
|
||||||
|
<view class="goods-gression">
|
||||||
|
<slot name="price"></slot>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="newdetail margin-bottom">
|
||||||
|
<!-- 入口区域 -->
|
||||||
|
<slot name="entrance"></slot>
|
||||||
|
|
||||||
|
<view class="item goods-attribute" @click="openAttributePopup()" v-if="goodsSkuDetail.goods_attr_format && goodsSkuDetail.goods_attr_format.length > 0">
|
||||||
|
<view class="label">属性</view>
|
||||||
|
<view class="box">
|
||||||
|
<text v-for="(item, index) in goodsSkuDetail.goods_attr_format" :key="index" v-if="index < 2">{{ item.attr_name }}: {{ item.attr_value_name }}</text>
|
||||||
|
</view>
|
||||||
|
<text class="iconfont iconright"></text>
|
||||||
|
<!-- <view class="img-wrap"><image :src="$util.img('public/picture/goods/detail_more.png')" mode="aspectFit" /></view> -->
|
||||||
|
</view>
|
||||||
|
<view class="item service" @click="openMerchantsServicePopup()" v-if="goodsSkuDetail.goods_service.length">
|
||||||
|
<view class="label">服务</view>
|
||||||
|
<view class="list-wrap">
|
||||||
|
<view class="item-wrap" v-for="(item, index) in goodsSkuDetail.goods_service" :key="index" v-if="index < 3">
|
||||||
|
<view class="item-wrap-box">
|
||||||
|
<view class="item-wrap-icon">
|
||||||
|
<text class="iconfont icondui" v-if="!item.icon || (!item.icon.imageUrl && !item.icon.icon)"></text>
|
||||||
|
<image class="icon-img" v-else-if="item.icon.iconType == 'img'" :src=" $util.img(item.icon.imageUrl)" />
|
||||||
|
<diy-icon class="icon-box" v-else-if="item.icon.iconType == 'icon'" :icon="item.icon.icon" :value="item.icon.style ? item.icon.style : null"></diy-icon>
|
||||||
|
</view>
|
||||||
|
<text>{{ item.service_name }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<text class="iconfont iconright"></text>
|
||||||
|
<!-- <view class="img-wrap"><image :src="$util.img('public/picture/goods/detail_more.png')" mode="aspectFit" /></view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品属性 -->
|
||||||
|
<view @touchmove.prevent.stop>
|
||||||
|
<uni-popup ref="attributePopup" type="bottom">
|
||||||
|
<view class="goods-attribute-popup-layer popup-layer">
|
||||||
|
<view class="head-wrap" @click="closeAttributePopup()">
|
||||||
|
<text>商品属性</text>
|
||||||
|
<text class="iconfont iconclose"></text>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y class="goods-attribute-body">
|
||||||
|
<view class="item" v-for="(item, index) in goodsSkuDetail.goods_attr_format" :key="index">
|
||||||
|
<text class="attr-name">{{ item.attr_name }}</text>
|
||||||
|
<text class="value-name">{{ item.attr_value_name }}</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="button-box"><button type="primary" @click="closeAttributePopup()">确定</button></view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品服务 -->
|
||||||
|
<view @touchmove.prevent.stop>
|
||||||
|
<uni-popup ref="merchantsServicePopup" type="bottom">
|
||||||
|
<view class="goods-merchants-service-popup-layer popup-layer">
|
||||||
|
<view class="head-wrap" @click="closeMerchantsServicePopup()">
|
||||||
|
<text>商品服务</text>
|
||||||
|
<text class="iconfont iconclose"></text>
|
||||||
|
</view>
|
||||||
|
<scroll-view scroll-y>
|
||||||
|
<view class="item" :class="{ 'empty-desc': !item.desc }" v-for="(item, index) in goodsSkuDetail.goods_service" :key="index">
|
||||||
|
<view class="item-icon" :class="{'empty-desc':!item.desc}">
|
||||||
|
<text class="iconfont icondui color-base-text" v-if="!item.icon || (!item.icon.imageUrl && !item.icon.icon)"></text>
|
||||||
|
<image class="icon-img" v-else-if="item.icon.iconType == 'img'" :src=" $util.img(item.icon.imageUrl)" />
|
||||||
|
<diy-icon class="icon-box" v-else-if="item.icon.iconType == 'icon'" :icon="item.icon.icon" :value="item.icon.style ? item.icon.style : null"></diy-icon>
|
||||||
|
</view>
|
||||||
|
<view class="info-wrap">
|
||||||
|
<text class="title">{{ item.service_name }}</text>
|
||||||
|
<text class="describe" v-if="item.desc">{{ item.desc }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
<view class="button-box"><button type="primary" @click="closeMerchantsServicePopup()">确定</button></view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 业务区域 -->
|
||||||
|
<slot name="business"></slot>
|
||||||
|
|
||||||
|
<view class="detail-community" v-if="goodsSkuDetail.qr_data && goodsSkuDetail.qr_data.qr_state == 1">
|
||||||
|
<view class="community-box">
|
||||||
|
<image :src="$util.img('public/picture/goods/detail_erweiImage.png')" mode="aspectFill"></image>
|
||||||
|
<view class="community-content">
|
||||||
|
<view class="community-title">{{ goodsSkuDetail.qr_data.qr_name }}</view>
|
||||||
|
<view class="community-txt">{{ goodsSkuDetail.qr_data.community_describe }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="community-btn" @click="onCommunity()">添加</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 促销 -->
|
||||||
|
<view class="community-model" @touchmove.prevent.stop @click.stop="onCloseCommunity()" v-show="isCommunity">
|
||||||
|
<view class="community-model-content" @click.stop>
|
||||||
|
<view class="community-model-content-radius"><view>添加社群</view></view>
|
||||||
|
<view class="community-model-content-draw" v-if="goodsSkuDetail.qr_data && goodsSkuDetail.qr_data.qr_img">
|
||||||
|
<image
|
||||||
|
:src="
|
||||||
|
goodsSkuDetail.qr_data.qr_img != '' && goodsSkuDetail.qr_data.qr_state == 1
|
||||||
|
? $util.img(goodsSkuDetail.qr_data.qr_img)
|
||||||
|
: $util.img('public/picture/goods/detail_erweiImage.png')
|
||||||
|
"
|
||||||
|
mode="aspectFill"
|
||||||
|
show-menu-by-longpress="true"
|
||||||
|
></image>
|
||||||
|
</view>
|
||||||
|
<view class="community-model-content-text">长按识别二维码,添加社群</view>
|
||||||
|
</view>
|
||||||
|
<view class="community-model-close" @click.stop="onCloseCommunity()"><text class="iconfont iconclose"></text></view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 参与流程 -->
|
||||||
|
<slot name="articipation"></slot>
|
||||||
|
|
||||||
|
<!-- 产品属性 -->
|
||||||
|
|
||||||
|
<!-- 商品评价 -->
|
||||||
|
<!-- <view class="group-wrap" v-if="evaluateConfig.evaluate_show == 1">-->
|
||||||
|
<!-- <view class="goods-evaluate" @click="toEvaluateDetail(goodsSkuDetail.goods_id)">-->
|
||||||
|
<!-- <view class="tit">-->
|
||||||
|
<!-- <!– <view class="tit" :class="{ active: goodsEvaluate.content }"> –>-->
|
||||||
|
<!-- <view>-->
|
||||||
|
<!-- <text class="color-title font-size-toolbar">-->
|
||||||
|
<!-- 评价-->
|
||||||
|
<!-- <text class="font-size-base">({{ goodsSkuDetail.evaluate }})</text>-->
|
||||||
|
<!-- </text>-->
|
||||||
|
<!-- <text class="evaluate-item-empty" v-if="!goodsSkuDetail.evaluate">暂无评价</text>-->
|
||||||
|
<!-- <view class="evaluate-item-empty" v-else>-->
|
||||||
|
<!-- <text class="font-size-tag">查看全部</text>-->
|
||||||
|
<!-- <text class="iconfont iconright font-size-tag"></text>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view class="evaluate-item" v-for="(item, index) in goodsEvaluate" :key="index" v-if="item.content">-->
|
||||||
|
<!-- <view class="evaluator">-->
|
||||||
|
<!-- <view class="evaluator-info">-->
|
||||||
|
<!-- <view class="evaluator-face">-->
|
||||||
|
<!-- <image-->
|
||||||
|
<!-- v-if="item.member_headimg"-->
|
||||||
|
<!-- :src="$util.img(item.member_headimg)"-->
|
||||||
|
<!-- @error="item.member_headimg = $util.getDefaultImage().head"-->
|
||||||
|
<!-- mode="aspectFill"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- <image-->
|
||||||
|
<!-- v-else-->
|
||||||
|
<!-- :src="$util.getDefaultImage().head"-->
|
||||||
|
<!-- @error="item.member_headimg = $util.getDefaultImage().head"-->
|
||||||
|
<!-- mode="aspectFill"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <text class="evaluator-name" v-if="item.member_name.length > 2 && item.is_anonymous == 1">-->
|
||||||
|
<!-- {{ item.member_name[0] }}***{{ item.member_name[item.member_name.length - 1] }}-->
|
||||||
|
<!-- </text>-->
|
||||||
|
<!-- <text class="evaluator-name" v-else>{{ item.member_name }}</text>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <text class="time color-tip">{{ $util.timeStampTurnTime(item.create_time) }}</text>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view class="cont margin-top">{{ item.content }}</view>-->
|
||||||
|
<!-- <scroll-view scroll-x="true">-->
|
||||||
|
<!-- <view class="evaluate-img" v-if="item.images">-->
|
||||||
|
<!-- <view class="img-box" v-for="(img, img_index) in item.images" :key="img_index" @click="previewEvaluate(index, img_index, 'images')">-->
|
||||||
|
<!-- <image :src="$util.img(img)" mode="aspectFill" />-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </scroll-view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
|
||||||
|
<!-- 详情 -->
|
||||||
|
<view class="goods-detail-tab">
|
||||||
|
<view class="detail-tab">
|
||||||
|
<!-- <view class="tab-line"></view> -->
|
||||||
|
<view class="tab-item">商品详情</view>
|
||||||
|
<!-- <view class="tab-line"></view> -->
|
||||||
|
<!-- <view v-if="service.is_display == 1" class="tab-item" :class="detailTab == 1 ? 'active color-base-text' : ''" @click="detailTab = 1">售后保障</view> -->
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="detail-content active" >
|
||||||
|
<view class="detail-content-item">
|
||||||
|
<view class="goods-details" v-if="goodsSkuDetail.goods_content">
|
||||||
|
<rich-text :nodes="goodsSkuDetail.goods_content" @click="showImg($event)" :data-nodes="goodsSkuDetail.goods_content"></rich-text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-details active" v-else>该商家暂无上传相关详情哦!</view>
|
||||||
|
</view>
|
||||||
|
<!-- <block v-if="service">
|
||||||
|
<view class="detail-content-item" v-show="detailTab == 1 && service.is_display == 1">
|
||||||
|
<view class="goods-details" v-if="service.content">
|
||||||
|
<rich-text :nodes="service.content" @click="showImg($event)" :data-nodes="service.content"></rich-text>
|
||||||
|
</view>
|
||||||
|
<view class="goods-details active" v-else>该商品暂无相关售后哦!</view>
|
||||||
|
</view>
|
||||||
|
</block> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品推荐 -->
|
||||||
|
<!-- <ns-goods-recommend ref="goodrecommend" route="goodsdetail"></ns-goods-recommend>-->
|
||||||
|
|
||||||
|
<ns-copyright></ns-copyright>
|
||||||
|
|
||||||
|
<!-- 海报 -->
|
||||||
|
<view @touchmove.prevent.stop>
|
||||||
|
<uni-popup ref="posterPopup" type="bottom" class="poster-layer">
|
||||||
|
<template v-if="poster != '-1'">
|
||||||
|
<view>
|
||||||
|
<view class="image-wrap"><image :src="$util.img(poster)" :show-menu-by-longpress="true" /></view>
|
||||||
|
<!-- #ifdef MP || APP-PLUS -->
|
||||||
|
<view class="save" @click="saveGoodsPoster()">保存图片</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class="save">长按保存图片</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
<view class="close iconfont iconclose" @click="closePosterPopup()"></view>
|
||||||
|
</template>
|
||||||
|
<view v-else class="msg">{{ posterMsg }}</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 分享弹窗 -->
|
||||||
|
<view @touchmove.prevent.stop>
|
||||||
|
<uni-popup ref="sharePopup" type="bottom" class="share-popup">
|
||||||
|
<view>
|
||||||
|
<view class="share-title">分享</view>
|
||||||
|
<view class="share-content">
|
||||||
|
<!-- #ifdef MP -->
|
||||||
|
<view class="share-box">
|
||||||
|
<button class="share-btn" :plain="true" open-type="share">
|
||||||
|
<view class="iconfont iconiconfenxianggeihaoyou"></view>
|
||||||
|
<text>分享给好友</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
|
<view class="share-box" v-if="goodsCircle">
|
||||||
|
<button class="share-btn" :plain="true" @click="openBusinessView">
|
||||||
|
<view class="iconfont iconhaowuquan"></view>
|
||||||
|
<text>分享到好物圈</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<view class="share-box" @click="openPosterPopup">
|
||||||
|
<button class="share-btn" :plain="true">
|
||||||
|
<view class="iconfont iconpengyouquan"></view>
|
||||||
|
<text>生成分享海报</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class="share-box" @click="copyUrl">
|
||||||
|
<button class="share-btn" :plain="true">
|
||||||
|
<view class="iconfont iconfuzhilianjie"></view>
|
||||||
|
<text>复制链接</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
</view>
|
||||||
|
<view class="share-footer" @click="closeSharePopup"><text>取消分享</text></view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<slot name="fixedbtn"></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 操作区域 -->
|
||||||
|
<slot name="action"></slot>
|
||||||
|
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||||
|
<ns-login ref="login"></ns-login>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 商品详情视图
|
||||||
|
import uniPopup from '@/components/uni-popup/uni-popup.vue';
|
||||||
|
import nsGoodsRecommend from '@/components/ns-goods-recommend/ns-goods-recommend.vue';
|
||||||
|
import scroll from '@/common/js/scroll-view.js';
|
||||||
|
import toTop from '@/components/toTop/toTop.vue';
|
||||||
|
import goodsDetailBase from '@/common/js/goods_detail_base.js';
|
||||||
|
import pengpaiFadeinOut from '@/components/pengpai-fadein-out/pengpai-fadein-out.vue';
|
||||||
|
import detail from './detail.js';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'goods-detail-view',
|
||||||
|
props: {
|
||||||
|
goodsSkuDetail: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
uniPopup,
|
||||||
|
nsGoodsRecommend,
|
||||||
|
pengpaiFadeinOut,
|
||||||
|
toTop
|
||||||
|
},
|
||||||
|
mixins: [scroll, detail]
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import '@/common/css/goods_detail.scss';
|
||||||
|
</style>
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -0,0 +1,408 @@
|
||||||
|
<!-- 省、市 两级地区选择器 -->
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<!-- 分享弹框 -->
|
||||||
|
<van-share-sheet
|
||||||
|
v-model="show"
|
||||||
|
title="立即分享给好友"
|
||||||
|
:close-on-click-overlay="false"
|
||||||
|
:options="options"
|
||||||
|
:cancel-text="''"
|
||||||
|
@click-overlay="cancel"
|
||||||
|
@cancel="cancel"
|
||||||
|
@select="onShare"
|
||||||
|
/>
|
||||||
|
<!-- 二维码弹框 -->
|
||||||
|
<van-popup ref="qrcodeContent" class="qrcode-content" v-model="share_qrcode_show">
|
||||||
|
<canvas ref="qrcode" canvas-id="share-qrcode" class="qrcode-canvas" />
|
||||||
|
</van-popup>
|
||||||
|
<!-- 海报弹框 -->
|
||||||
|
<van-popup class="poster-content" v-model="share_poster_show">
|
||||||
|
<canvas ref="posterImage" canvas-id="posterImage" id="posterImage" class="poster-image" />
|
||||||
|
<image :src="poster_image" :show-menu-by-longpress="true" class="poster-image poster-show-image"/>
|
||||||
|
</van-popup>
|
||||||
|
<!--<view v-if="share_poster_show" class="poster-tip">-->
|
||||||
|
<!-- <view class="download-button" @click="downloadPoster">下载海报</view>-->
|
||||||
|
<!--</view>-->
|
||||||
|
|
||||||
|
<view v-if="share_poster_show" class="poster-tip">长按图片保存</view>
|
||||||
|
<!--同意关闭按钮-->
|
||||||
|
<van-button v-if="share_poster_show || share_qrcode_show" type="danger" size="small" class="cancel-btn" @click="cancelAll">
|
||||||
|
关闭
|
||||||
|
</van-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import uQRCode from 'common/js/uqrcode.js'
|
||||||
|
import {Weixin} from "../../common/js/wx-jssdk";
|
||||||
|
import Http from "../../common/js/http";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'share-panel',
|
||||||
|
props:{
|
||||||
|
// 是否显示
|
||||||
|
show:{
|
||||||
|
type: Boolean,
|
||||||
|
default: function() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 分享信息
|
||||||
|
share: {
|
||||||
|
type: Object,
|
||||||
|
default: function() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 分享参数
|
||||||
|
shareParams: {
|
||||||
|
type: Array,
|
||||||
|
default: function() {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad() {},
|
||||||
|
onShow() {},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
userInfo: {},
|
||||||
|
path: '',
|
||||||
|
options: [
|
||||||
|
// { name: '微信', icon: 'wechat' },
|
||||||
|
{ name: '复制链接', icon: 'link' },
|
||||||
|
{ name: '分享海报', icon: 'poster' },
|
||||||
|
{ name: '二维码', icon: 'qrcode' },
|
||||||
|
],
|
||||||
|
share_qrcode_show: false,// 二维码分享
|
||||||
|
share_poster_show: false,// 海报分享
|
||||||
|
share_id: '',
|
||||||
|
|
||||||
|
poster_image: '',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
share: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
|
||||||
|
this.createSharePath();
|
||||||
|
this.setPublicShare();
|
||||||
|
},
|
||||||
|
immediate: false,
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
mounted() {
|
||||||
|
// 生成唯一分享id
|
||||||
|
this.createShareId();
|
||||||
|
// 获取个人信息
|
||||||
|
this.getUserInfo();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//获取个人信息
|
||||||
|
getUserInfo() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/api/member/info',
|
||||||
|
success: res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.userInfo = res.data;
|
||||||
|
|
||||||
|
this.createSharePath();
|
||||||
|
this.setPublicShare();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 关闭
|
||||||
|
cancel(){
|
||||||
|
this.$emit('close');
|
||||||
|
},
|
||||||
|
// 关闭全部
|
||||||
|
cancelAll(){
|
||||||
|
this.share_qrcode_show = false;
|
||||||
|
this.share_poster_show = false;
|
||||||
|
|
||||||
|
this.cancel();
|
||||||
|
},
|
||||||
|
// 点击分享
|
||||||
|
onShare(option,index){
|
||||||
|
this.recordSharing();
|
||||||
|
// 根据点击的类型进行对应的分享操作
|
||||||
|
let icon = option.icon;
|
||||||
|
switch (icon){
|
||||||
|
case 'link': this.shareLink();break;
|
||||||
|
case 'poster': this.sharePoster();break;
|
||||||
|
case 'qrcode': this.shareQrcode();break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 分享 —— 复制链接
|
||||||
|
shareLink(){
|
||||||
|
this.$util.copy(this.path);
|
||||||
|
this.cancel();
|
||||||
|
},
|
||||||
|
// 分享 —— 二维码
|
||||||
|
shareQrcode(is_get = false){
|
||||||
|
let _this = this;
|
||||||
|
_this.cancel();
|
||||||
|
_this.share_qrcode_show = true
|
||||||
|
return new Promise((req, rej) => {
|
||||||
|
_this.$nextTick(() => {
|
||||||
|
if(is_get) _this.$refs.qrcodeContent.$el.style.marginLeft = '50000px';
|
||||||
|
else _this.$refs.qrcodeContent.$el.style.marginLeft = '0';
|
||||||
|
let size = _this.$refs.qrcode.$el.offsetHeight;
|
||||||
|
uQRCode.make({
|
||||||
|
canvasId: 'share-qrcode',
|
||||||
|
componentInstance: this,
|
||||||
|
text: _this.path,
|
||||||
|
size: size,
|
||||||
|
margin: 10,
|
||||||
|
backgroundColor: '#ffffff',
|
||||||
|
foregroundColor: '#000000',
|
||||||
|
fileType: 'jpg',
|
||||||
|
errorCorrectLevel: uQRCode.errorCorrectLevel.H,
|
||||||
|
success: res => {
|
||||||
|
req(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 分享 —— 生成海报
|
||||||
|
async sharePoster(){
|
||||||
|
// 显示内容
|
||||||
|
let _this = this;
|
||||||
|
_this.share_poster_show = true;
|
||||||
|
let backgroundImage = _this.$util.img('public/picture/aijiu/article_bg.jpg');// 背景图片
|
||||||
|
let avatar = _this.$util.img( _this.userInfo.headimg );// 用户头像
|
||||||
|
let qrcode = '';
|
||||||
|
await _this.shareQrcode(true).then((res)=>{
|
||||||
|
qrcode = res;
|
||||||
|
_this.share_qrcode_show = false
|
||||||
|
});
|
||||||
|
// 开始绘制
|
||||||
|
_this.$nextTick(() => {
|
||||||
|
// 获取画布大小
|
||||||
|
let width = _this.$refs.posterImage.$el.offsetWidth;// 300
|
||||||
|
let height = _this.$refs.posterImage.$el.offsetHeight;// 510
|
||||||
|
// 生成基本画布
|
||||||
|
let ctx = uni.createCanvasContext('posterImage', this);
|
||||||
|
ctx.setFillStyle('#ffffff'); // 默认白色
|
||||||
|
ctx.fillRect(0, 0, width, height);// fillRect(x,y,宽度,高度)
|
||||||
|
// 绘制背景图
|
||||||
|
ctx.drawImage(backgroundImage, 0, 0, width , height) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度)
|
||||||
|
// 绘制头像
|
||||||
|
_this.drawAvatar(ctx,avatar,width);
|
||||||
|
// 绘制用户昵称
|
||||||
|
let nicknameLen = this.userInfo.nickname.length;
|
||||||
|
let nicknameX = (width / 2) - (nicknameLen * 20 / 2);
|
||||||
|
ctx.setFillStyle('#000000');
|
||||||
|
_this.drawText(ctx,"20px Microsoft YaHei",this.userInfo.nickname,nicknameX,230,width)
|
||||||
|
// 绘制文字
|
||||||
|
ctx.setFillStyle('#a67344');
|
||||||
|
_this.drawText(ctx,"20px Microsoft YaHei","欢迎关注",110,45,width)
|
||||||
|
_this.drawText(ctx,"20px Microsoft YaHei","全叶真爱",110,70,width)
|
||||||
|
// 邀请词
|
||||||
|
let invitation = "邀请您一起学养生,懂健康";
|
||||||
|
let len = invitation.length;
|
||||||
|
let invitationX = (width / 2) - (len * 15 / 2);
|
||||||
|
_this.drawText(ctx,"15px Microsoft YaHei",invitation,invitationX,270,width)
|
||||||
|
// 二维码
|
||||||
|
let qrcodeSize = 100;
|
||||||
|
ctx.drawImage(qrcode, (width / 2 - (qrcodeSize / 2)), 290, qrcodeSize , qrcodeSize) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度)
|
||||||
|
// 将内容绘制到画布上面
|
||||||
|
ctx.draw(true,function () {
|
||||||
|
|
||||||
|
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'posterImage',
|
||||||
|
success: (res) => {
|
||||||
|
//console.log(res.tempFilePath);
|
||||||
|
_this.poster_image = res.tempFilePath
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log("失败")
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 生成海报 —— 绘制头像
|
||||||
|
drawAvatar(ctx,avatar,width){
|
||||||
|
let arcX = width / 2;
|
||||||
|
let avatarSize = 40;
|
||||||
|
ctx.save();
|
||||||
|
// 绘制头像背景
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.fillStyle = "#d7c08a";
|
||||||
|
ctx.arc(arcX,160,45,0,2*Math.PI);
|
||||||
|
ctx.fill();
|
||||||
|
// 绘制头像
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(arcX,160, avatarSize, 0, Math.PI * 2);
|
||||||
|
ctx.clip();
|
||||||
|
ctx.drawImage(avatar, arcX - avatarSize, 160 - avatarSize , avatarSize * 2 , avatarSize * 2) // drawImage(图片路径,x,y,绘制图像的宽度,绘制图像的高度)
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.restore();
|
||||||
|
},
|
||||||
|
// 生成海报 —— 绘制文字
|
||||||
|
drawText(ctx,size,text,x,y,maxWidth){
|
||||||
|
ctx.save();
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.font = size;
|
||||||
|
ctx.fillText(text, x, y, maxWidth);
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.restore();
|
||||||
|
},
|
||||||
|
// 点击下载海报
|
||||||
|
downloadPoster(){
|
||||||
|
uni.canvasToTempFilePath({
|
||||||
|
canvasId: 'posterImage',
|
||||||
|
success: (res) => {
|
||||||
|
uni.downloadFile({
|
||||||
|
url: res.tempFilePath,
|
||||||
|
success: (res) => {
|
||||||
|
var link = document.createElement('a') //创建一个a标签
|
||||||
|
link.href = res.tempFilePath//把a标签的href属性赋值到生成好了的url
|
||||||
|
link.download = '邀请好友.png'//通过a标签的download属性修改下载图片的名字
|
||||||
|
link.click()//让a标签的click函数,直接下载图片
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: function(err) {
|
||||||
|
console.log("失败canvasToTempFilePath")
|
||||||
|
console.log(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 记录分享信息
|
||||||
|
recordSharing(){
|
||||||
|
let _this = this;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/api/ShareRecord/recordShareInfo',
|
||||||
|
data: { share_path: _this.path }
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 设置公众号分享信息
|
||||||
|
setPublicShare(){
|
||||||
|
let shareUrl = this.path;
|
||||||
|
let _this = this;
|
||||||
|
this.$util.setPublicShare({
|
||||||
|
title: _this.share.title, // 分享标题
|
||||||
|
desc: _this.share.desc, // 分享描述
|
||||||
|
link: shareUrl,
|
||||||
|
imgUrl: _this.$util.img(_this.share.imgUrl), // 分享图标
|
||||||
|
},function (params) {
|
||||||
|
Http.sendRequest({
|
||||||
|
url: '/api/ShareRecord/recordShareInfo',
|
||||||
|
data: { share_path: params.link },
|
||||||
|
success: res => {},
|
||||||
|
fail:err=>{}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 生成唯一的分享id
|
||||||
|
createShareId(){
|
||||||
|
let timeDate = new Date()
|
||||||
|
this.share_id = timeDate.getTime().toString();
|
||||||
|
},
|
||||||
|
// 生成分享链接
|
||||||
|
createSharePath(){
|
||||||
|
// 生成唯一id
|
||||||
|
this.createShareId();
|
||||||
|
let member_id = this.userInfo.member_id;
|
||||||
|
this.path = '';
|
||||||
|
// 生成分享链接
|
||||||
|
if(this.share.link){
|
||||||
|
// 如果传递了分享链接 使用分享链接
|
||||||
|
this.path = this.share.link + `?source_member=${member_id}&share_id=` + this.share_id.toString();
|
||||||
|
}else{
|
||||||
|
// 没有分享链接 生成分享链接
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
let currentPage = pages[pages.length - 1].$page
|
||||||
|
let currentPath = currentPage.path + `?source_member=${member_id}&share_id=` + this.share_id.toString();
|
||||||
|
let options = currentPage.options;
|
||||||
|
// 获取分享的参数
|
||||||
|
if(Object.keys(this.shareParams).length > 0){
|
||||||
|
this.shareParams.forEach(function (item, index) {
|
||||||
|
if(options[item]) currentPath = currentPath + `&${item}=` + options[item];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let split = window.location.href.split(currentPage.path)
|
||||||
|
this.path = split[0] + currentPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.qrcode-content{
|
||||||
|
width: 60vw;
|
||||||
|
height: 60vw;
|
||||||
|
.qrcode-canvas{
|
||||||
|
width: 60vw;
|
||||||
|
height: 60vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.poster-content{
|
||||||
|
--poster-size-: 300px; // 海报的大小
|
||||||
|
width: var(--poster-size-);
|
||||||
|
height: calc(var(--poster-size-) * 1.7);
|
||||||
|
|
||||||
|
.poster-image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.poster-show-image{
|
||||||
|
position: absolute;
|
||||||
|
z-index: 555555;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.poster-tip {
|
||||||
|
position: absolute;
|
||||||
|
font-size: 50rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
z-index: 99999;
|
||||||
|
bottom: 160rpx;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.download-button{
|
||||||
|
color: #fff;
|
||||||
|
background: #ee0a24;
|
||||||
|
width: 100px;
|
||||||
|
border-radius: 30px;
|
||||||
|
font-size: 15px;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.cancel-btn{
|
||||||
|
position: absolute;
|
||||||
|
top: 40rpx;
|
||||||
|
right: 40rpx;
|
||||||
|
z-index: 999999;
|
||||||
|
width: 100rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
border-radius: 50rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
4
main.js
4
main.js
|
|
@ -10,6 +10,10 @@ import Lang from './common/js/lang.js'
|
||||||
import Config from './common/js/config.js'
|
import Config from './common/js/config.js'
|
||||||
import globalConfig from './common/js/golbalConfig.js';
|
import globalConfig from './common/js/golbalConfig.js';
|
||||||
|
|
||||||
|
// import Vant from 'vant';
|
||||||
|
// import 'vant/lib/index.less';
|
||||||
|
// Vue.use(Vant);
|
||||||
|
|
||||||
Vue.prototype.$store = store //挂在vue
|
Vue.prototype.$store = store //挂在vue
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ https://unpkg.com/jweixin-module/out/index.js
|
||||||
## 使用
|
## 使用
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var wx = require('jweixin-module')
|
var jweixin = require('jweixin-module')
|
||||||
wx.ready(function(){
|
jweixin.ready(function(){
|
||||||
// TODO
|
// TODO
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,28 +1,27 @@
|
||||||
{
|
{
|
||||||
"_from": "jweixin-module",
|
"_from": "jweixin-module@1.6.0",
|
||||||
"_id": "jweixin-module@1.4.1",
|
"_id": "jweixin-module@1.6.0",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha512-2R2oa1lYhAsclfjKSf3DP4ZiP1dcrQUbM7aklbeJA+UAg/LS7MqoA6UbTy1cs4sbB34z62K4bKW0Z9iazD8ejg==",
|
"_integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==",
|
||||||
"_location": "/jweixin-module",
|
"_location": "/jweixin-module",
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "tag",
|
"type": "version",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "jweixin-module",
|
"raw": "jweixin-module@1.6.0",
|
||||||
"name": "jweixin-module",
|
"name": "jweixin-module",
|
||||||
"escapedName": "jweixin-module",
|
"escapedName": "jweixin-module",
|
||||||
"rawSpec": "",
|
"rawSpec": "1.6.0",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "latest"
|
"fetchSpec": "1.6.0"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"#USER",
|
|
||||||
"/"
|
"/"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.4.1.tgz",
|
"_resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
|
||||||
"_shasum": "1fc8fa42622243f6c35651d272cd587debf56cd1",
|
"_shasum": "4a7ea614083e3c9c3f49e2fdc2bb882cfa58dfcd",
|
||||||
"_spec": "jweixin-module",
|
"_spec": "jweixin-module@1.6.0",
|
||||||
"_where": "E:\\demo\\niushop_uniapp",
|
"_where": "D:\\Web-Object\\rush-goods",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Shengqiang Guo"
|
"name": "Shengqiang Guo"
|
||||||
},
|
},
|
||||||
|
|
@ -32,10 +31,7 @@
|
||||||
"bundleDependencies": false,
|
"bundleDependencies": false,
|
||||||
"deprecated": false,
|
"deprecated": false,
|
||||||
"description": "微信JS-SDK",
|
"description": "微信JS-SDK",
|
||||||
"devDependencies": {
|
"devDependencies": {},
|
||||||
"textfile": "^1.2.0",
|
|
||||||
"uglify-js": "^3.4.9"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
|
"homepage": "https://github.com/zhetengbiji/jweixin-module#readme",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"wxjssdk",
|
"wxjssdk",
|
||||||
|
|
@ -46,15 +42,12 @@
|
||||||
"wx"
|
"wx"
|
||||||
],
|
],
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"main": "out/index.js",
|
"main": "lib/index.js",
|
||||||
"name": "jweixin-module",
|
"name": "jweixin-module",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
|
"url": "git+https://github.com/zhetengbiji/jweixin-module.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {},
|
||||||
"build": "node build",
|
"version": "1.6.0"
|
||||||
"prepublish": "npm run build"
|
|
||||||
},
|
|
||||||
"version": "1.4.1"
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,55 @@
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mescroll-uni": {
|
"@babel/runtime": {
|
||||||
"version": "1.1.8",
|
"version": "7.19.4",
|
||||||
"resolved": "https://registry.npmjs.org/mescroll-uni/-/mescroll-uni-1.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.19.4.tgz",
|
||||||
"integrity": "sha512-l1JJP6NVc5pCkojNWz7U1kcdw7f40ZDS1PGJ8NEI5/TDn22AKahLQJCdKTWwpx+jOZWX+aSiwFsIvcz11cnidQ=="
|
"integrity": "sha512-EXpLCrk55f+cYqmHsSR+yD/0gAIMxxA9QK9lnQWzhMCvt+YmoBN7Zx94s++Kv0+unHk39vxNO8t+CMA2WSS3wA==",
|
||||||
|
"requires": {
|
||||||
|
"regenerator-runtime": "^0.13.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@vant/icons": {
|
||||||
|
"version": "1.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vant/icons/-/icons-1.8.0.tgz",
|
||||||
|
"integrity": "sha512-sKfEUo2/CkQFuERxvkuF6mGQZDKu3IQdj5rV9Fm0weJXtchDSSQ+zt8qPCNUEhh9Y8shy5PzxbvAfOOkCwlCXg=="
|
||||||
|
},
|
||||||
|
"@vant/popperjs": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vant/popperjs/-/popperjs-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw=="
|
||||||
|
},
|
||||||
|
"@vue/babel-helper-vue-jsx-merge-props": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-JkqXfCkUDp4PIlFdDQ0TdXoIejMtTHP67/pvxlgeY+u5k3LEdKuWZ3LK6xkxo52uDoABIVyRwqVkfLQJhk7VBA=="
|
||||||
|
},
|
||||||
|
"jweixin-module": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jweixin-module/-/jweixin-module-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w=="
|
||||||
|
},
|
||||||
|
"regenerator-runtime": {
|
||||||
|
"version": "0.13.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz",
|
||||||
|
"integrity": "sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw=="
|
||||||
|
},
|
||||||
|
"vant": {
|
||||||
|
"version": "2.12.51",
|
||||||
|
"resolved": "https://registry.npmjs.org/vant/-/vant-2.12.51.tgz",
|
||||||
|
"integrity": "sha512-0dZHcBWwKdQvgvAMr5hqObuwkHRn51c7ReLVDV/Ijp1twZ/9/JGMPKVCp1ebpzFAONudyDvu42adrkFUhheaUA==",
|
||||||
|
"requires": {
|
||||||
|
"@babel/runtime": "7.x",
|
||||||
|
"@vant/icons": "^1.7.1",
|
||||||
|
"@vant/popperjs": "^1.1.0",
|
||||||
|
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
|
||||||
|
"vue-lazyload": "1.2.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vue-lazyload": {
|
||||||
|
"version": "1.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue-lazyload/-/vue-lazyload-1.2.3.tgz",
|
||||||
|
"integrity": "sha512-DC0ZwxanbRhx79tlA3zY5OYJkH8FYp3WBAnAJbrcuoS8eye1P73rcgAZhyxFSPUluJUTelMB+i/+VkNU/qVm7g=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"vant": "^2.12.51",
|
||||||
|
"jweixin-module": "^1.4.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
101
pages.json
101
pages.json
|
|
@ -104,8 +104,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"subPackages": [{
|
"subPackages": [
|
||||||
|
{
|
||||||
//******************营销活动模块(26)******************
|
//******************营销活动模块(26)******************
|
||||||
"root": "pages_promotion",
|
"root": "pages_promotion",
|
||||||
"pages": [
|
"pages": [
|
||||||
|
|
@ -639,7 +639,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "礼品卡"
|
"navigationBarTitleText": "礼品卡"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/member",
|
"path": "giftcard/member",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -647,7 +648,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "我的"
|
"navigationBarTitleText": "我的"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/detail",
|
"path": "giftcard/detail",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -655,7 +657,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/order_list",
|
"path": "giftcard/order_list",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -663,7 +666,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "订单列表"
|
"navigationBarTitleText": "订单列表"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/order_detail",
|
"path": "giftcard/order_detail",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -671,7 +675,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "订单详情"
|
"navigationBarTitleText": "订单详情"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/list",
|
"path": "giftcard/list",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -680,7 +685,8 @@
|
||||||
"navigationBarTitleText": "卡包"
|
"navigationBarTitleText": "卡包"
|
||||||
}
|
}
|
||||||
|
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/card_info",
|
"path": "giftcard/card_info",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -688,7 +694,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "礼品卡详情"
|
"navigationBarTitleText": "礼品卡详情"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/give",
|
"path": "giftcard/give",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -696,7 +703,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "礼品卡赠送"
|
"navigationBarTitleText": "礼品卡赠送"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/give_info",
|
"path": "giftcard/give_info",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -704,7 +712,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "领取礼品卡"
|
"navigationBarTitleText": "领取礼品卡"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/member_give_info",
|
"path": "giftcard/member_give_info",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -712,7 +721,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "礼品卡详情"
|
"navigationBarTitleText": "礼品卡详情"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/exchange",
|
"path": "giftcard/exchange",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -720,7 +730,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "卡密激活"
|
"navigationBarTitleText": "卡密激活"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/payment",
|
"path": "giftcard/payment",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -728,7 +739,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "待付款订单"
|
"navigationBarTitleText": "待付款订单"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/receive_list",
|
"path": "giftcard/receive_list",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -736,7 +748,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "收到的卡片"
|
"navigationBarTitleText": "收到的卡片"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/give_list",
|
"path": "giftcard/give_list",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -744,7 +757,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "赠送的卡片"
|
"navigationBarTitleText": "赠送的卡片"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/card_use",
|
"path": "giftcard/card_use",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -752,7 +766,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "礼品卡使用"
|
"navigationBarTitleText": "礼品卡使用"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/not_exist",
|
"path": "giftcard/not_exist",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -760,7 +775,8 @@
|
||||||
//#endif
|
//#endif
|
||||||
"navigationBarTitleText": "礼品卡不存在"
|
"navigationBarTitleText": "礼品卡不存在"
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "giftcard/use_select",
|
"path": "giftcard/use_select",
|
||||||
"style": {
|
"style": {
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
|
@ -931,7 +947,56 @@
|
||||||
// #endif
|
// #endif
|
||||||
"navigationBarTitleText": "分销商"
|
"navigationBarTitleText": "分销商"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "fenxiao/apply_upgrade",
|
||||||
|
"style": {
|
||||||
|
// #ifdef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
|
"navigationBarTitleText": "分销商升级申请"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
//****************** 文章 ******************
|
||||||
|
{
|
||||||
|
"path": "article/list",
|
||||||
|
"style": {
|
||||||
|
// #ifdef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
|
"navigationBarTitleText": "文章"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "article/record",
|
||||||
|
"style": {
|
||||||
|
// #ifdef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
|
"navigationBarTitleText": "文章"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "article/detail",
|
||||||
|
"style": {
|
||||||
|
// #ifdef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
|
"navigationBarTitleText": "文章"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//****************** 交易市场 ******************
|
||||||
|
{
|
||||||
|
"path": "futures/list",
|
||||||
|
"style": {
|
||||||
|
// #ifdef H5
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
// #endif
|
||||||
|
"navigationBarTitleText": "交易市场"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,530 @@
|
||||||
|
<template>
|
||||||
|
<page-meta :page-style="themeColor"></page-meta>
|
||||||
|
<view class="page">
|
||||||
|
<loading-cover v-if="loading" ref="loadingCover"></loading-cover>
|
||||||
|
<!--文章标题-->
|
||||||
|
<view class="help-title">{{ detail.article_title }}</view>
|
||||||
|
<view class="help-meta">
|
||||||
|
<text class="help-time">发表时间: {{ detail.create_time }}</text>
|
||||||
|
</view>
|
||||||
|
<!--用户信息 存在分享人则显示分享人信息,不存在则显示本人信息 -->
|
||||||
|
<!-- <view class="user">-->
|
||||||
|
<!-- <view class="avatar" @click="goToPage">-->
|
||||||
|
<!-- <image class="avatar-image" :src="$util.img(member.headimg)"></image>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view class="info" @click="goToPage">-->
|
||||||
|
<!-- <view class="nickname">{{ member.nickname }}</view>-->
|
||||||
|
<!-- <view class="phone">{{ member.mobile }}</view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view class="btn">-->
|
||||||
|
<!-- <!–判断:当前用户存在推荐人且本人不是分销商-显示推荐人信息,不存在推荐人或者本人是分销商-显示本人信息; 当:本人不是分销商或者会员卡已过期-显示升级名片,本人是分销商且会员卡未过期-显示我要推广–>-->
|
||||||
|
<!-- <view class="btn-item" v-if="member.show_type === 'upgrade'" @click="onUpgrade">升级名片</view>-->
|
||||||
|
<!-- <view class="btn-item" v-else @click="share_panel = true">我要分享</view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!--文章内容-->
|
||||||
|
<view class="help-content">
|
||||||
|
<rich-text :nodes="content"></rich-text>
|
||||||
|
</view>
|
||||||
|
<!--浏览量和点赞-->
|
||||||
|
<view class="bottom">
|
||||||
|
<view class="browse">{{ set_info.browse_text || '浏览量' }}{{ detail.read_num }}次数</view>
|
||||||
|
<view class="bottom-list">
|
||||||
|
<view class="fabulous" @click="fabulous">
|
||||||
|
<van-icon v-if="detail.is_fabulous > 0" class="good-job" name="good-job" />
|
||||||
|
<van-icon v-else class="good-job-o" name="good-job-o" />
|
||||||
|
赞 {{ detail.dianzan_num }}
|
||||||
|
</view>
|
||||||
|
<view class="share_panel" @click="share_panel = true"><image class="my-icon" src="./public/img/fenxiang.png"></image>分享</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 推荐阅读 -->
|
||||||
|
<view class="recommend">
|
||||||
|
<!--顶部内容-->
|
||||||
|
<view class="top">
|
||||||
|
<view class="title">推荐阅读</view>
|
||||||
|
<view class="more-info" @click="$util.redirectTo('/pages_promotion/article/list')">
|
||||||
|
查看更多<van-icon class="arrow" name="arrow" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!--推荐列表-->
|
||||||
|
<view class="article">
|
||||||
|
<van-list v-model="list_loading" :finished="finished" finished-text="" @load="getList">
|
||||||
|
<view class="article-block" v-for="(item,index) in list" :key="index" @click="goToDetail(item.article_id)">
|
||||||
|
|
||||||
|
<view class="block-content">
|
||||||
|
<view class="content-title">{{ item.article_title }}</view>
|
||||||
|
<view class="content-abstract">{{ item.article_abstract }}</view>
|
||||||
|
<view class="content-info">
|
||||||
|
<view class="content-info-item">
|
||||||
|
<image class="my-icon" src="./public/img/liulan.png"></image>
|
||||||
|
{{ item.read_num }}
|
||||||
|
</view>
|
||||||
|
<view class="content-info-item">
|
||||||
|
<image class="my-icon" src="./public/img/dianzan.png"></image>
|
||||||
|
{{ item.dianzan_num }}
|
||||||
|
</view>
|
||||||
|
<view class="content-info-item" style="width: 160rpx">{{ item.create_time.split(" ")[0] }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="img">
|
||||||
|
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-list>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部tabBar -->
|
||||||
|
<view class="page-bottom"><diy-bottom-nav></diy-bottom-nav></view>
|
||||||
|
<!--分享面板-->
|
||||||
|
<share :show="share_panel" @close="share_panel = false" :share="share_info" :shareParams="share_params"></share>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import htmlParser from '@/common/js/html-parser';
|
||||||
|
import share from '@/components/share-panel/share-panel';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components:{
|
||||||
|
share
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
set_info: {},
|
||||||
|
loading: true,
|
||||||
|
articleId: 0,
|
||||||
|
detail: {},
|
||||||
|
content: '',
|
||||||
|
share_panel: false,
|
||||||
|
member_id: 0,
|
||||||
|
member:{},
|
||||||
|
|
||||||
|
page: 1 ,
|
||||||
|
list: [],
|
||||||
|
list_loading: false, // 是否处于加载状态,加载过程中不触发load事件
|
||||||
|
finished: false, // 是否已加载完成,加载完成后不再触发load事件
|
||||||
|
|
||||||
|
share_info:{},
|
||||||
|
share_params: [
|
||||||
|
'article_id'
|
||||||
|
],
|
||||||
|
|
||||||
|
source_member: 0,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
this.articleId = options.article_id || 0;
|
||||||
|
if (this.articleId == 0) {
|
||||||
|
this.$util.redirectTo('/pages_tool/help/list', {}, 'redirectTo');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 分享奖励
|
||||||
|
if(options.source_member && options.share_id) this.shareReward(options);
|
||||||
|
// 分享接收 source_member
|
||||||
|
if (options.source_member) uni.setStorageSync('source_member', options.source_member);
|
||||||
|
// 获取数据
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
//记录分享关系
|
||||||
|
if(uni.getStorageSync('token') && uni.getStorageSync('source_member')){
|
||||||
|
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getSetting()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取文章详情
|
||||||
|
getData() {
|
||||||
|
let _this = this;
|
||||||
|
let source_member = uni.getStorageSync('source_member') || 0;
|
||||||
|
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/details',
|
||||||
|
data: { article_id: _this.articleId, source_member: source_member },
|
||||||
|
success: res => {
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
_this.detail = res.data;
|
||||||
|
// _this.member = res.member;
|
||||||
|
_this.$langConfig.title(this.detail.article_title);
|
||||||
|
_this.content = htmlParser(this.detail.article_content);
|
||||||
|
|
||||||
|
_this.share_info = {
|
||||||
|
title: _this.detail.article_title, // 分享标题
|
||||||
|
desc: _this.detail.article_abstract, // 分享描述
|
||||||
|
imgUrl: _this.detail.cover_img, // 分享图标
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.$util.showToast({
|
||||||
|
title: res.message
|
||||||
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$util.redirectTo('/pages_promotion/article/list', {}, 'redirectTo');
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.loading = false;
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
_this.loading = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 点击升级名片
|
||||||
|
onUpgrade(){
|
||||||
|
if(this.member.level_expire_time > 0) this.$util.redirectTo('/pages_tool/member/card')
|
||||||
|
else this.$util.redirectTo('/pages_tool/member/card_buy')
|
||||||
|
},
|
||||||
|
// 点击进入名片
|
||||||
|
goToPage(){
|
||||||
|
this.$util.redirectTo('/pages_promotion/card/homepage')
|
||||||
|
},
|
||||||
|
// 获取基本设置
|
||||||
|
getSetting(){
|
||||||
|
let _this = this;
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/setInfo',
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
_this.set_info = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 点击点赞按钮
|
||||||
|
fabulous(){
|
||||||
|
let _this = this;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/fabulous',
|
||||||
|
data: { article_id: _this.articleId },
|
||||||
|
success: res => {
|
||||||
|
this.$util.showToast({
|
||||||
|
title: res.message
|
||||||
|
});
|
||||||
|
if (res.code === 0) _this.getData();
|
||||||
|
},
|
||||||
|
fail: res => {}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取文章列表
|
||||||
|
getList(){
|
||||||
|
let _this = this;
|
||||||
|
this.list_loading = true;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/articleList',
|
||||||
|
data: {
|
||||||
|
page_size: 10,
|
||||||
|
page: _this.page,
|
||||||
|
is_rand: 1,
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
_this.list_loading = false;
|
||||||
|
let data = res.data;
|
||||||
|
|
||||||
|
if(_this.page === 1) _this.list = data.list;
|
||||||
|
else _this.list = _this.list.concat(data.list);
|
||||||
|
_this.page++;
|
||||||
|
// 推荐列表 仅加载一页
|
||||||
|
_this.finished = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 点击跳转 —— 文章详情
|
||||||
|
goToDetail(id) {
|
||||||
|
this.$util.redirectTo('/pages_promotion/article/detail', { article_id: id });
|
||||||
|
},
|
||||||
|
// 获取分享奖励
|
||||||
|
shareReward(options){
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/getShareReward',
|
||||||
|
data: options,
|
||||||
|
success: res => {
|
||||||
|
console.log(res);
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('分享奖励失败',res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
var title = this.detail.article_title;
|
||||||
|
var path = '/pages_promotion/article/detail?article_id=' + this.articleId;
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
path: path,
|
||||||
|
success: res => {},
|
||||||
|
fail: res => {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.page {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 30rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background: #ffffff;
|
||||||
|
user-select: auto;
|
||||||
|
.help-title {
|
||||||
|
font-size: 40rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
line-height: 60rpx;
|
||||||
|
}
|
||||||
|
.help-content {
|
||||||
|
margin-top: $margin-updown;
|
||||||
|
word-break: break-all;
|
||||||
|
user-select: auto;
|
||||||
|
}
|
||||||
|
.help-meta {
|
||||||
|
text-align: right;
|
||||||
|
margin-top: $margin-updown;
|
||||||
|
color: $color-tip;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
.share-o{
|
||||||
|
margin-right: 6rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.help-time {
|
||||||
|
font-size: $font-size-tag;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.user{
|
||||||
|
margin: 40rpx 0;
|
||||||
|
background: #f6f7fb;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
padding: 30rpx;
|
||||||
|
width: calc(100% - 60rpx);
|
||||||
|
height: 120rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-items: center;
|
||||||
|
.avatar{
|
||||||
|
height: 120rpx;
|
||||||
|
width: 120rpx;
|
||||||
|
|
||||||
|
.avatar-image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info{
|
||||||
|
width: calc(100% - 120rpx - 170rpx);
|
||||||
|
padding-left: 20rpx;
|
||||||
|
|
||||||
|
.nickname{
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.phone{
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.btn{
|
||||||
|
width: 170rpx;
|
||||||
|
.btn-item{
|
||||||
|
background: #de3242;
|
||||||
|
border-radius: 40rpx;
|
||||||
|
width: 160rpx;
|
||||||
|
text-align: center;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #FFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
.bottom{
|
||||||
|
margin: 30rpx 0;
|
||||||
|
font-size: 26rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 60rpx;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
.browse{
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
.bottom-list{
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 280rpx;
|
||||||
|
.fabulous{
|
||||||
|
color: #909399;
|
||||||
|
border: 1px solid #dddddd;
|
||||||
|
border-radius: 100rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
|
||||||
|
.good-job-o{
|
||||||
|
color: #909399;
|
||||||
|
font-size: 34rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
.good-job{
|
||||||
|
color: #e02e42;
|
||||||
|
font-size: 34rpx;
|
||||||
|
margin-right: 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.share_panel{
|
||||||
|
line-height: 64rpx;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.recommend{
|
||||||
|
.top{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
margin: 50rpx 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.title{
|
||||||
|
padding-left: 30rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
|
.title::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 14rpx;
|
||||||
|
width: 6rpx;
|
||||||
|
height: calc(100% - (14rpx * 2));
|
||||||
|
background: #527010;
|
||||||
|
}
|
||||||
|
.more-info{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #8f9298;
|
||||||
|
.arrow{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article{
|
||||||
|
.article-block{
|
||||||
|
width: 100%;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 180rpx;
|
||||||
|
position: relative;
|
||||||
|
.img{
|
||||||
|
width: 260rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
.image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.block-content{
|
||||||
|
width: calc(100% - 290rpx);
|
||||||
|
height: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.content-title{
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-abstract{
|
||||||
|
height: 40rpx;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
//text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
//font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: block;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-info{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: flex-end;
|
||||||
|
.content-info-item{
|
||||||
|
width: 85rpx;
|
||||||
|
font-size: 26rpx!important;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article-block::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
height: 1px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 20rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-icon {
|
||||||
|
top: 3px;
|
||||||
|
height: 15px;
|
||||||
|
width: 15px;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
font: normal normal normal 14px/1 'vant-icon';
|
||||||
|
font-size: inherit;
|
||||||
|
text-rendering: auto;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,728 @@
|
||||||
|
<template>
|
||||||
|
<!--<loading-cover v-if="loading" ref="loadingCover"></loading-cover>-->
|
||||||
|
<page-meta :page-style="themeColor"></page-meta>
|
||||||
|
<view id="articleList">
|
||||||
|
<!--搜索框-->
|
||||||
|
<!-- <van-search shape="round" v-model="search_title" show-action placeholder="请输入文章标题">-->
|
||||||
|
<!-- <template #action>-->
|
||||||
|
<!-- <view class="search" @click="goToSign">-->
|
||||||
|
<!-- <view class="img">-->
|
||||||
|
<!-- <image :src="$util.img('public/picture/aijiu/sign.png')" mode="aspectFit"></image>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- <view class="sign-button">签到</view>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </van-search>-->
|
||||||
|
<!--分类标题栏-->
|
||||||
|
<view class="top-buttons">
|
||||||
|
<view class="cate">
|
||||||
|
<van-tabs v-model="cate_ids" scrollspy :swipe-threshold="3" color="#527010">
|
||||||
|
<van-tab v-for="(item,index) in cate_list" :key="index" :name="item.category_id" :title="item.category_name"></van-tab>
|
||||||
|
</van-tabs>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="sort">-->
|
||||||
|
<!-- <van-dropdown-menu>-->
|
||||||
|
<!-- <van-dropdown-item v-model="sort_value" :options="sort_list" />-->
|
||||||
|
<!-- </van-dropdown-menu>-->
|
||||||
|
<!-- </view>-->
|
||||||
|
</view>
|
||||||
|
<!--轮播图-->
|
||||||
|
<van-swipe v-if="set_info.banner_list && cate_ids === 'recommend'" class="swipe" :autoplay="3000" indicator-color="white">
|
||||||
|
<van-swipe-item v-for="item in set_info.banner_list">
|
||||||
|
<image class="image-item" :src="$util.img(item)" mode="aspectFit"></image>
|
||||||
|
</van-swipe-item>
|
||||||
|
</van-swipe>
|
||||||
|
<!-- hot阅读 -->
|
||||||
|
<view class="hot" v-if="cate_ids === 'recommend'">
|
||||||
|
<!--顶部内容-->
|
||||||
|
<view class="top">
|
||||||
|
<view class="title">热门文章</view>
|
||||||
|
</view>
|
||||||
|
<!--推荐列表-->
|
||||||
|
<view class="article">
|
||||||
|
<scroll-view scroll-x="true">
|
||||||
|
<view class="article-block" v-for="(item,index) in hot_list" :key="index" @click="goToDetail(item.article_id)">
|
||||||
|
<view class="img">
|
||||||
|
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||||
|
</view>
|
||||||
|
<view class="block-content">
|
||||||
|
<view class="content-title">{{ item.article_title }}</view>
|
||||||
|
<view class="content-abstract">{{ item.article_abstract }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 推荐阅读 -->
|
||||||
|
<view class="recommend" v-if="cate_ids === 'recommend'">
|
||||||
|
<!--顶部内容-->
|
||||||
|
<view class="top">
|
||||||
|
<view class="title">精选推荐</view>
|
||||||
|
<view class="more-info" @click="cate_ids = 'recommend-list'">
|
||||||
|
查看更多<van-icon class="arrow" name="arrow" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!--推荐列表-->
|
||||||
|
<view class="article">
|
||||||
|
<van-list v-model="list_loading" :finished="finished" finished-text="" @load="getList">
|
||||||
|
<view class="article-block" v-for="(item,index) in recommend_list" :key="index" @click="goToDetail(item.article_id)">
|
||||||
|
|
||||||
|
<view class="block-content">
|
||||||
|
<view class="content-title">{{ item.article_title }}</view>
|
||||||
|
<view class="content-abstract">{{ item.article_abstract }}</view>
|
||||||
|
<view class="content-info">
|
||||||
|
<view class="content-info-item">
|
||||||
|
<image class="my-icon" src="./public/img/liulan.png"></image>
|
||||||
|
{{ item.read_num }}
|
||||||
|
</view>
|
||||||
|
<view class="content-info-item">
|
||||||
|
<image class="my-icon" src="./public/img/dianzan.png"></image>
|
||||||
|
{{ item.dianzan_num }}
|
||||||
|
</view>
|
||||||
|
<view class="content-info-item" style="width: 160rpx">{{ item.create_time.split(" ")[0] }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="img">
|
||||||
|
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-list>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!--文章列表-->
|
||||||
|
<view class="article" v-if="cate_ids !== 'recommend'">
|
||||||
|
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getList">
|
||||||
|
<view class="article-block" v-for="(item,index) in list" :key="index" @click="goToDetail(item.article_id)">
|
||||||
|
<view class="block-content">
|
||||||
|
<view class="content-title">{{ item.article_title }}</view>
|
||||||
|
<view class="content-abstract">{{ item.article_abstract }}</view>
|
||||||
|
<view class="content-info">
|
||||||
|
<view class="content-info-item">
|
||||||
|
<image class="my-icon" src="./public/img/liulan.png"></image>
|
||||||
|
{{ item.read_num }}
|
||||||
|
</view>
|
||||||
|
<view class="content-info-item">
|
||||||
|
<image class="my-icon" src="./public/img/dianzan.png"></image>
|
||||||
|
{{ item.dianzan_num }}
|
||||||
|
</view>
|
||||||
|
<view class="content-info-item" style="width: 160rpx">{{ item.create_time.split(" ")[0] }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="img">
|
||||||
|
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-list>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部tabBar -->
|
||||||
|
<view class="page-bottom"><diy-bottom-nav></diy-bottom-nav></view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
cate_list: [],
|
||||||
|
set_info: [],
|
||||||
|
list: [],
|
||||||
|
hot_list: [],
|
||||||
|
recommend_list: [],
|
||||||
|
loading: false, // 是否处于加载状态,加载过程中不触发load事件
|
||||||
|
finished: false, // 是否已加载完成,加载完成后不再触发load事件
|
||||||
|
// 排序内容
|
||||||
|
sort_value: 'new',
|
||||||
|
sort_list: [
|
||||||
|
{ text: '最新', value: 'new' },
|
||||||
|
{ text: '推荐', value: 'recommend' },
|
||||||
|
{ text: '热门', value: 'hot' },
|
||||||
|
{ text: '点赞', value: 'fabulous' },
|
||||||
|
],
|
||||||
|
// 列表相关
|
||||||
|
page: 1,
|
||||||
|
search_title: '',
|
||||||
|
cate_ids: 'recommend',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {},
|
||||||
|
watch:{
|
||||||
|
'search_title':{
|
||||||
|
handler() {
|
||||||
|
this.page = 1;
|
||||||
|
this.list = [];
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'cate_ids':{
|
||||||
|
handler() {
|
||||||
|
this.page = 1;
|
||||||
|
this.list = [];
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'sort_value':{
|
||||||
|
handler() {
|
||||||
|
this.page = 1;
|
||||||
|
this.list = [];
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getCateList();
|
||||||
|
this.getSetting();
|
||||||
|
this.getHotList();
|
||||||
|
this.getRecommendList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取文章分类
|
||||||
|
getCateList(){
|
||||||
|
let _this = this;
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/cateList',
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
let list = [
|
||||||
|
{category_id: 'recommend', category_name: '推荐'},
|
||||||
|
// {category_id: '', category_name: '全部'}
|
||||||
|
];
|
||||||
|
_this.cate_list = list.concat(res.data);
|
||||||
|
_this.cate_list = _this.cate_list.concat([
|
||||||
|
{category_id: 'recommend-list', category_name: '精选推荐'}
|
||||||
|
])
|
||||||
|
}else {
|
||||||
|
this.$util.showToast({
|
||||||
|
title: res.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取基本设置
|
||||||
|
getSetting(){
|
||||||
|
let _this = this;
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/setInfo',
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
let data = res.data;
|
||||||
|
data.banner_list = JSON.parse(data.banner_list);
|
||||||
|
|
||||||
|
_this.set_info = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取文章列表
|
||||||
|
getList(){
|
||||||
|
let _this = this;
|
||||||
|
this.loading = true;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/articleList',
|
||||||
|
data: {
|
||||||
|
page_size: 10,
|
||||||
|
page: _this.page,
|
||||||
|
search_text: _this.search_title,
|
||||||
|
cate_ids: _this.cate_ids === 'recommend-list' ? '' : _this.cate_ids,
|
||||||
|
orders: _this.sort_value,
|
||||||
|
is_recommend: _this.cate_ids === 'recommend-list' ? 1 : 0
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
_this.loading = false;
|
||||||
|
let data = res.data;
|
||||||
|
|
||||||
|
if(_this.page === 1) _this.list = data.list;
|
||||||
|
else _this.list = _this.list.concat(data.list);
|
||||||
|
_this.page++;
|
||||||
|
// 加载完成 判断是否为最后一页
|
||||||
|
if (_this.page > data.page_count) _this.finished = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取热门文章列表
|
||||||
|
getHotList(){
|
||||||
|
let _this = this;
|
||||||
|
this.loading = true;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/articleList',
|
||||||
|
data: {
|
||||||
|
page_size: 10,
|
||||||
|
is_hot: 1,
|
||||||
|
page: 1,
|
||||||
|
search_text: '',
|
||||||
|
cate_ids: '',
|
||||||
|
orders: ''
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
_this.loading = false;
|
||||||
|
let data = res.data;
|
||||||
|
_this.hot_list = _this.list.concat(data.list);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取推荐文章列表
|
||||||
|
getRecommendList(){
|
||||||
|
let _this = this;
|
||||||
|
this.loading = true;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/articleList',
|
||||||
|
data: {
|
||||||
|
page_size: 10,
|
||||||
|
is_recommend: 1,
|
||||||
|
page: 1,
|
||||||
|
search_text: '',
|
||||||
|
cate_ids: '',
|
||||||
|
orders: ''
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
_this.loading = false;
|
||||||
|
let data = res.data;
|
||||||
|
_this.recommend_list = _this.list.concat(data.list);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 点击跳转 —— 文章详情
|
||||||
|
goToDetail(id) {
|
||||||
|
this.$util.redirectTo('/pages_promotion/article/detail', { article_id: id });
|
||||||
|
},
|
||||||
|
// 点击跳转 —— 签到
|
||||||
|
goToSign() {
|
||||||
|
this.$util.redirectTo('/pages_tool/member/signin');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
var title = '文章列表';
|
||||||
|
var path = '/pages_promotion/article/list';
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
path: path,
|
||||||
|
success: res => {},
|
||||||
|
fail: res => {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/deep/ .van-search__content{
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
}
|
||||||
|
#articleList{
|
||||||
|
padding: 0 10px;
|
||||||
|
background: #ffffff;
|
||||||
|
.search{
|
||||||
|
width: 70rpx;
|
||||||
|
height: 70rpx;
|
||||||
|
text-align: center;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: stretch;
|
||||||
|
.img{
|
||||||
|
image{
|
||||||
|
width: 100%;
|
||||||
|
height: 34rpx;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sign-button{
|
||||||
|
height: 30rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
line-height: 30rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.top-buttons{
|
||||||
|
height: 90rpx;
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-content: center;
|
||||||
|
align-items: flex-end;
|
||||||
|
|
||||||
|
.cate{
|
||||||
|
height: 100%;
|
||||||
|
//width: calc(100% - 150rpx);
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
/deep/ .van-tabs{
|
||||||
|
height: 100%;
|
||||||
|
.van-tabs__wrap{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sort{
|
||||||
|
--sort-width--: 140rpx;
|
||||||
|
height: 100%;
|
||||||
|
width: var(--sort-width--);
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
/deep/ .van-dropdown-menu{
|
||||||
|
height: 100%!important;
|
||||||
|
width: var(--sort-width--);
|
||||||
|
.van-dropdown-menu__bar{
|
||||||
|
height: 100%!important;
|
||||||
|
width: var(--sort-width--);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.sort::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: calc((100% - 60rpx) / 2);
|
||||||
|
width: 4rpx;
|
||||||
|
height: 60rpx;
|
||||||
|
background: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.swipe{
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100vw / 2);
|
||||||
|
padding: 0;
|
||||||
|
margin: 20rpx 0;
|
||||||
|
|
||||||
|
.image-item{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
/deep/ div{
|
||||||
|
background-size: 100% 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article{
|
||||||
|
.article-block{
|
||||||
|
width: 100%;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 180rpx;
|
||||||
|
position: relative;
|
||||||
|
.img{
|
||||||
|
width: 260rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
.image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.block-content{
|
||||||
|
width: calc(100% - 290rpx);
|
||||||
|
height: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.content-title{
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-abstract{
|
||||||
|
height: 40rpx;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
//text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
//font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: block;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-info{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: flex-end;
|
||||||
|
.content-info-item{
|
||||||
|
width: 85rpx;
|
||||||
|
font-size: 26rpx!important;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article-block::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
height: 1px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 20rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.recommend{
|
||||||
|
.top{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
margin: 50rpx 0 10rpx 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.title{
|
||||||
|
padding-left: 20rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 900;
|
||||||
|
|
||||||
|
}
|
||||||
|
//.title::after{
|
||||||
|
// content: "";
|
||||||
|
// position: absolute;
|
||||||
|
// left: 0;
|
||||||
|
// top: 14rpx;
|
||||||
|
// width: 6rpx;
|
||||||
|
// height: calc(100% - (14rpx * 2));
|
||||||
|
// background: #e02e42;
|
||||||
|
//}
|
||||||
|
.more-info{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #8f9298;
|
||||||
|
.arrow{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article{
|
||||||
|
.article-block{
|
||||||
|
width: 100%;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 180rpx;
|
||||||
|
position: relative;
|
||||||
|
.img{
|
||||||
|
width: 260rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
.image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.block-content{
|
||||||
|
width: calc(100% - 290rpx);
|
||||||
|
height: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.content-title{
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-abstract{
|
||||||
|
height: 40rpx;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
//text-align: center;
|
||||||
|
font-size: 24rpx;
|
||||||
|
//font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: block;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-info{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: flex-end;
|
||||||
|
.content-info-item{
|
||||||
|
width: 85rpx;
|
||||||
|
font-size: 26rpx!important;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article-block::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
height: 1px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 20rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.hot{
|
||||||
|
.top{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 60rpx;
|
||||||
|
line-height: 60rpx;
|
||||||
|
margin: 50rpx 0 10rpx 0;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.title{
|
||||||
|
padding-left: 20rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
font-weight: 900;
|
||||||
|
|
||||||
|
}
|
||||||
|
.more-info{
|
||||||
|
font-size: 26rpx;
|
||||||
|
color: #8f9298;
|
||||||
|
.arrow{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article{
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
height: calc(65vw / 2);
|
||||||
|
.article-block{
|
||||||
|
display: inline-block;
|
||||||
|
width: 55vw;
|
||||||
|
padding: 20rpx 16rpx;
|
||||||
|
height: calc(65vw / 2);
|
||||||
|
.img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
.image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.block-content{
|
||||||
|
width: calc(100%);
|
||||||
|
height: 100%;
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
top: calc(-65vw / 4 - 36rpx);
|
||||||
|
color: #ffffff;
|
||||||
|
|
||||||
|
.content-title{
|
||||||
|
margin: auto;
|
||||||
|
overflow: hidden;
|
||||||
|
/*这里要显示的设置宽度*/
|
||||||
|
white-space:nowrap;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
width: 80%;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: block;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-abstract{
|
||||||
|
margin: auto;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-top: 16rpx;
|
||||||
|
white-space:nowrap;
|
||||||
|
text-align: center;
|
||||||
|
color: #ffffff;
|
||||||
|
width: 60%;
|
||||||
|
font-size: 24rpx;
|
||||||
|
//font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: block;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article-block::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
height: 1px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 20rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-icon {
|
||||||
|
top: 3px;
|
||||||
|
height: 15px;
|
||||||
|
width: 15px;
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
font: normal normal normal 14px/1 'vant-icon';
|
||||||
|
font-size: inherit;
|
||||||
|
text-rendering: auto;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
|
|
@ -0,0 +1,243 @@
|
||||||
|
<template>
|
||||||
|
<page-meta :page-style="themeColor"></page-meta>
|
||||||
|
<view id="record">
|
||||||
|
<!--顶部搜索-->
|
||||||
|
<van-search shape="round" v-model="search_title" placeholder="请输入文章标题"></van-search>
|
||||||
|
<!--文章列表-->
|
||||||
|
<view class="article">
|
||||||
|
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="recordList">
|
||||||
|
<view class="article-block" v-for="(item,index) in list" :key="index">
|
||||||
|
<view class="img" @click="goToDetail(item.article_id)">
|
||||||
|
<image class="image" :src="$util.img(item.cover_img)"></image>
|
||||||
|
</view>
|
||||||
|
<view class="block-content">
|
||||||
|
<view class="content-title" @click="goToDetail(item.article_id)">{{ item.article_title }}</view>
|
||||||
|
<view class="content-info">
|
||||||
|
<view class="content-info-item">{{ item.time }}</view>
|
||||||
|
<view class="content-info-item">
|
||||||
|
<van-button v-if="record_type === 'browse'" @click="deleteBrowseRecord(item.article_id)" class="danger-btn" type="danger" size="mini" round>
|
||||||
|
删除
|
||||||
|
</van-button>
|
||||||
|
<van-button v-else-if="record_type === 'fabulous'" @click="deleteBrowseRecord(item.article_id)" class="danger-btn" type="danger" size="mini" round>
|
||||||
|
取消点赞
|
||||||
|
</van-button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</van-list>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 底部tabBar -->
|
||||||
|
<view class="page-bottom"><diy-bottom-nav></diy-bottom-nav></view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
record_type: '',
|
||||||
|
record_type_name:{
|
||||||
|
'share': '分享',
|
||||||
|
'fabulous': '点赞',
|
||||||
|
'browse': '浏览',
|
||||||
|
},
|
||||||
|
// 列表相关
|
||||||
|
page: 1,
|
||||||
|
search_title: '',
|
||||||
|
cate_ids: '',
|
||||||
|
list: [],
|
||||||
|
loading: false, // 是否处于加载状态,加载过程中不触发load事件
|
||||||
|
finished: false, // 是否已加载完成,加载完成后不再触发load事件
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onShow() {},
|
||||||
|
onLoad(options) {
|
||||||
|
// 参数获取
|
||||||
|
let _this = this;
|
||||||
|
_this.record_type = options.record_type;
|
||||||
|
|
||||||
|
// 页面标题
|
||||||
|
uni.setNavigationBarTitle({
|
||||||
|
title: _this.record_type_name[options.record_type] + '记录',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
search_title: {
|
||||||
|
handler: function () {
|
||||||
|
this.page = 1;
|
||||||
|
this.recordList();
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.recordList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取文章列表
|
||||||
|
recordList(){
|
||||||
|
let _this = this;
|
||||||
|
this.loading = true;
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/getRecordList',
|
||||||
|
data: {
|
||||||
|
page_size: 10,
|
||||||
|
page: _this.page,
|
||||||
|
search_text: _this.search_title,
|
||||||
|
record_type: _this.record_type
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
if(res.code === 0){
|
||||||
|
_this.loading = false;
|
||||||
|
let data = res.data;
|
||||||
|
|
||||||
|
if(_this.page === 1) _this.list = data.list;
|
||||||
|
else _this.list = _this.list.concat(data.list);
|
||||||
|
_this.page++;
|
||||||
|
// 加载完成 判断是否为最后一页
|
||||||
|
if (_this.page > data.page_count) _this.finished = true;
|
||||||
|
}else{
|
||||||
|
this.$dialog.alert({ message: res.message }).then(res =>{
|
||||||
|
_this.$util.redirectTo('/pages_promotion/member/personal_center');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 点击跳转 —— 文章详情
|
||||||
|
goToDetail(id) {
|
||||||
|
this.$util.redirectTo('/pages_promotion/article/detail', { article_id: id });
|
||||||
|
},
|
||||||
|
// 删除浏览记录、取消点赞
|
||||||
|
deleteBrowseRecord(article_id){
|
||||||
|
let _this = this;
|
||||||
|
let tips = '删除';
|
||||||
|
if(_this.record_type === 'fabulous') tips = '取消点赞';
|
||||||
|
_this.$dialog.confirm({ message: `确认${tips}?${tips}后不可恢复!` }).then(()=>{
|
||||||
|
_this.$api.sendRequest({
|
||||||
|
url: '/article/api/index/delRecordInfo',
|
||||||
|
data: {
|
||||||
|
record_type: _this.record_type,
|
||||||
|
article_id: article_id
|
||||||
|
},
|
||||||
|
success: res => {
|
||||||
|
this.$dialog.alert({ message: res.message }).then(()=>{
|
||||||
|
_this.page = 1;
|
||||||
|
_this.recordList();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onShareAppMessage(res) {
|
||||||
|
var title = '记录';
|
||||||
|
var path = '/pages_promotion/article/record.vue';
|
||||||
|
return {
|
||||||
|
title: title,
|
||||||
|
path: path,
|
||||||
|
success: res => {},
|
||||||
|
fail: res => {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
#record{
|
||||||
|
background: #ffffff; // ffffff
|
||||||
|
padding: 0 10px;
|
||||||
|
|
||||||
|
.article{
|
||||||
|
.article-block{
|
||||||
|
width: 100%;
|
||||||
|
padding: 20rpx 0;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 180rpx;
|
||||||
|
position: relative;
|
||||||
|
.img{
|
||||||
|
width: 260rpx;
|
||||||
|
height: 180rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
.image{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.block-content{
|
||||||
|
width: calc(100% - 290rpx);
|
||||||
|
height: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
.content-title{
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 40rpx;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
}
|
||||||
|
.content-info{
|
||||||
|
width: 100%;
|
||||||
|
display: inline-flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: flex-end;
|
||||||
|
.content-info-item{
|
||||||
|
font-size: 26rpx!important;
|
||||||
|
color: #999999;
|
||||||
|
|
||||||
|
.danger-btn{
|
||||||
|
padding: 0 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.article-block::after{
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
width: calc(100% - 40rpx);
|
||||||
|
height: 1px;
|
||||||
|
bottom: 0;
|
||||||
|
left: 20rpx;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
<template>
|
||||||
|
<page-meta :page-style="themeColor"></page-meta>
|
||||||
|
<view class="apply">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--加载动画-->
|
||||||
|
<loading-cover ref="loadingCover"></loading-cover>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
mixins: [],
|
||||||
|
onLoad(option) {
|
||||||
|
|
||||||
|
},
|
||||||
|
async onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onBackPress(options) {
|
||||||
|
if (options.from === 'navigateBack') return false;
|
||||||
|
this.$util.redirectTo('/pages/member/index');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -19,63 +19,67 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="fenxiao-level-wrap" v-if="levelList.length">
|
<!--<view class="fenxiao-level-wrap" v-if="levelList.length">
|
||||||
<image :src="$util.img('public/uniapp/fenxiao/index/level_icon.png')" mode="heightFix" class="level-icon"></image>
|
<image :src="$util.img('public/uniapp/fenxiao/index/level_icon.png')" mode="heightFix" class="level-icon"></image>
|
||||||
<view class="level-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/level')">
|
<view class="level-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/level')">
|
||||||
<view class="title">{{ info.level_num > 0 ? info.level_name : '等级未解锁' }}</view>
|
<view class="title">{{ info.level_num > 0 ? info.level_name : '等级未解锁' }}</view>
|
||||||
<view class="desc">下单、邀请好友均可提升等级</view>
|
<view class="desc">下单、邀请好友均可提升等级</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="$refs.taskPopup.open()" v-if="info.condition.last_level">做任务</view>
|
<view class="btn" @click="$refs.taskPopup.open()" v-if="info.condition.last_level">做任务</view>
|
||||||
|
</view>-->
|
||||||
|
<view class="fenxiao-level-wrap" v-if="levelList.length">
|
||||||
|
<image :src="$util.img('public/uniapp/fenxiao/index/level_icon.png')" mode="heightFix" class="level-icon"></image>
|
||||||
|
<view class="level-wrap">
|
||||||
|
<view class="title">{{ info.level_name }}</view>
|
||||||
|
<view class="desc" v-if="parseInt(info.is_apply_upgrade) === 1">提交申请可以提升等级!</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="$util.redirectTo('/pages_promotion/fenxiao/apply_upgrade')" v-if="parseInt(info.is_apply_upgrade) === 1">申请升级</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="fenxiao-index-allmoney">-->
|
<!-- <view class="fenxiao-index-allmoney">
|
||||||
<!-- <view class="allmoney-top-money">-->
|
<view class="allmoney-top-money">
|
||||||
<!-- <view class="allmoney-top">-->
|
<view class="allmoney-top">
|
||||||
<!-- <view class="font-size-sub">可{{ fenxiaoWords.withdraw }}(元)</view>-->
|
<view class="font-size-sub">可{{ fenxiaoWords.withdraw }}(元)</view>
|
||||||
<!-- <view class="withdrawal-record" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">提现记录<text class="iconfont icon-right"></text></view>-->
|
<view class="withdrawal-record" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">提现记录<text class="iconfont icon-right"></text></view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<!-- <view class="total-commission price-font">{{ info.account }}</view>-->
|
<view class="total-commission price-font">{{ info.account }}</view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
|
|
||||||
<!-- <view class="allmoney-bottom">-->
|
<view class="allmoney-bottom">
|
||||||
<!-- <view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">-->
|
<view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
||||||
<!-- <view class="title">总{{ fenxiaoWords.account }}</view>-->
|
<view class="title">总{{ fenxiaoWords.account }}</view>
|
||||||
<!-- <view class="money price-font">{{ info.total_commission | moneyFormat }}</view>-->
|
<view class="money price-font">{{ info.total_commission | moneyFormat }}</view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<!-- <view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">-->
|
<view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">
|
||||||
<!-- <view class="title">已提现{{ fenxiaoWords.account }}</view>-->
|
<view class="title">已提现{{ fenxiaoWords.account }}</view>
|
||||||
<!-- <view class="money price-font">{{ info.account_withdraw | moneyFormat }}</view>-->
|
<view class="money price-font">{{ info.account_withdraw | moneyFormat }}</view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<!-- <view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">-->
|
<view class="allmoney-all-wrap" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_list')">
|
||||||
<!-- <view class="title">提现中{{ fenxiaoWords.account }}</view>-->
|
<view class="title">提现中{{ fenxiaoWords.account }}</view>
|
||||||
<!-- <view class="money price-font">{{ info.account_withdraw_apply | moneyFormat }}</view>-->
|
<view class="money price-font">{{ info.account_withdraw_apply | moneyFormat }}</view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<!-- </view>-->
|
</view>
|
||||||
<!-- <view class="withdraw-btn" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_apply')">申请提现</view>-->
|
<view class="withdraw-btn" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_apply')">申请提现</view>
|
||||||
<!-- </view>-->
|
</view>-->
|
||||||
|
|
||||||
<view
|
<!-- <view class="account-info">
|
||||||
class="account-info">
|
<view class="solid"></view>
|
||||||
<!-- v-show="value.style == 2"-->
|
|
||||||
<!-- :style="{ 'margin-left': parseInt(value.infoMargin) * 2 + 'rpx', 'margin-right': parseInt(value.infoMargin) * 2 + 'rpx' }"-->
|
|
||||||
|
|
||||||
<!-- <view class="solid"></view>-->
|
|
||||||
<view class="account-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
<view class="account-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
||||||
<view class="value price-font">{{ info && info.points != undefined ? info.points : '--' }}</view>
|
<view class="value price-font">{{ info && info.points != undefined ? info.points : '--' }}</view>
|
||||||
<view class="title">积分</view>
|
<view class="title">积分</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="solid"></view>
|
<view class="solid"></view>
|
||||||
<view class="account-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
<view class="account-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
||||||
<view class="value price-font">{{ info && info.contribution != undefined ? info.contribution : '--' }}</view>
|
<view class="value price-font">{{ info && info.contribution != undefined ? info.contribution : '--' }}</view>
|
||||||
<view class="title">贡献值</view>
|
<view class="title">贡献值</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="solid"></view>
|
<view class="solid"></view>
|
||||||
<view class="account-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
<view class="account-item" @click="$util.redirectTo('/pages_promotion/fenxiao/bill')">
|
||||||
<view class="value price-font">{{ info && info.house_purchase != undefined ? info.house_purchase : '--' }}</view>
|
<view class="value price-font">{{ info && info.house_purchase != undefined ? info.house_purchase : '--' }}</view>
|
||||||
<view class="title">购房券</view>
|
<view class="title">购房券</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>-->
|
||||||
|
|
||||||
<view class="fenxiao-team">
|
<view class="fenxiao-team">
|
||||||
<view class="fenxiao-index-other">
|
<view class="fenxiao-index-other">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
<template>
|
||||||
|
<page-meta :page-style="themeColor"></page-meta>
|
||||||
|
<view class="apply">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--加载动画-->
|
||||||
|
<loading-cover ref="loadingCover"></loading-cover>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {},
|
||||||
|
mixins: [],
|
||||||
|
onLoad(option) {
|
||||||
|
|
||||||
|
},
|
||||||
|
async onShow() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
onBackPress(options) {
|
||||||
|
if (options.from === 'navigateBack') return false;
|
||||||
|
this.$util.redirectTo('/pages/member/index');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
module.exports = {
|
||||||
|
chainWebpack: (config) => {
|
||||||
|
config.module
|
||||||
|
.rule("mjs$")
|
||||||
|
.test(/\.mjs$/)
|
||||||
|
.include.add(/node_modules/)
|
||||||
|
.end()
|
||||||
|
.type("javascript/auto");
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue