Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
63d4bb1627 | |||
cfb4330609 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,7 +2,6 @@
|
|||||||
node_modules
|
node_modules
|
||||||
/dist
|
/dist
|
||||||
.hbuilderx
|
.hbuilderx
|
||||||
unpackage
|
|
||||||
|
|
||||||
# local env files
|
# local env files
|
||||||
.env.local
|
.env.local
|
||||||
|
239
App.vue
239
App.vue
@ -8,10 +8,6 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// #ifdef APP-PLUS
|
|
||||||
let jpushModule = uni.requireNativePlugin("JG-JPush");
|
|
||||||
import { initEvent } from "@/utils/uniMPevent.js";
|
|
||||||
// #endif
|
|
||||||
import {
|
import {
|
||||||
checkLogin
|
checkLogin
|
||||||
} from "./libs/login";
|
} from "./libs/login";
|
||||||
@ -23,13 +19,7 @@
|
|||||||
history
|
history
|
||||||
} from '@/api/public.js'
|
} from '@/api/public.js'
|
||||||
import Routine from './libs/routine.js';
|
import Routine from './libs/routine.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
audioTeam: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
globalData: {
|
globalData: {
|
||||||
spid: 0,
|
spid: 0,
|
||||||
code: 0,
|
code: 0,
|
||||||
@ -74,43 +64,8 @@
|
|||||||
...uni.getStorageSync('GLOBAL_DATA') || {}
|
...uni.getStorageSync('GLOBAL_DATA') || {}
|
||||||
},
|
},
|
||||||
onLaunch: function(option) {
|
onLaunch: function(option) {
|
||||||
// #ifdef H5
|
|
||||||
uni.setTabBarItem({
|
|
||||||
index: 1,
|
|
||||||
visible: false
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
|
||||||
this.globalData.uid = this.$store.state.app.uid;
|
this.globalData.uid = this.$store.state.app.uid
|
||||||
// let appkey = uni.getStorage({
|
|
||||||
// key: 'launchFlag'
|
|
||||||
// })
|
|
||||||
// if (appkey) {
|
|
||||||
// setTimeout(() => {
|
|
||||||
// this.$store.dispatch('INIT_CONFIG');
|
|
||||||
// }, 6000)
|
|
||||||
// }
|
|
||||||
this.$store.dispatch('INIT_CONFIG');
|
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
//初始化uniMP小程序发送的事件以及其他操作
|
|
||||||
initEvent();
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// uni.getLocation({
|
|
||||||
// type: 'gcj02',
|
|
||||||
// geocode: true,
|
|
||||||
// isHighAccuracy: true,
|
|
||||||
// // altitude: true,
|
|
||||||
// // accuracy: 'best',
|
|
||||||
// success: (res)=> {
|
|
||||||
// console.log(res);
|
|
||||||
// },
|
|
||||||
// fail(e) {
|
|
||||||
// console.log(e);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
let that = this;
|
let that = this;
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
if (HTTP_REQUEST_URL == '') {
|
if (HTTP_REQUEST_URL == '') {
|
||||||
@ -160,76 +115,8 @@
|
|||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
that.getConfigData()
|
that.getConfigData()
|
||||||
|
|
||||||
//#ifdef APP-PLUS
|
|
||||||
this.checknetwork()
|
|
||||||
|
|
||||||
jpushModule.setLoggerEnable(true);
|
|
||||||
jpushModule.initJPushService()
|
|
||||||
jpushModule.addConnectEventListener(result => {
|
|
||||||
let connectEnable = result.connectEnable
|
|
||||||
// console.log("jpush连接", connectEnable)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
// 设置别名
|
|
||||||
// jpushModule.setAlias({
|
|
||||||
// 'alias': uni.getStorageSync('userId'),
|
|
||||||
// 'sequence': 1
|
|
||||||
// })
|
|
||||||
//
|
|
||||||
// jpushModule.addTagAliasListener(result => {
|
|
||||||
// let code = result.code
|
|
||||||
// let sequence = result.sequence
|
|
||||||
// let tags = result.tags
|
|
||||||
// let tag = result.tag
|
|
||||||
// let tagEnable = result.tagEnable
|
|
||||||
// let alias = result.alias
|
|
||||||
// console.log(alias, '别名')
|
|
||||||
// })
|
|
||||||
// 通知事件回调
|
|
||||||
jpushModule.addNotificationListener(result => {
|
|
||||||
let notificationEventType = result.notificationEventType
|
|
||||||
let messageID = result.messageID
|
|
||||||
let title = result.title
|
|
||||||
let content = result.content
|
|
||||||
let extras = result.extras
|
|
||||||
|
|
||||||
console.log("通知", result)
|
|
||||||
|
|
||||||
if (result.extras.type == 'ORDER_CREATE') {
|
|
||||||
if (this.audioTeam.length > 0) {
|
|
||||||
this.audioTeam.push(result.extras.type);
|
|
||||||
} else {
|
|
||||||
this.audio()
|
|
||||||
this.audioTeam.push(result.extras.type);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
// 点击事件
|
|
||||||
if (notificationEventType == 'notificationOpened') {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: result.extras.route
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// jpushModule.addCustomMessageListener(result => {
|
|
||||||
// let messageID = result.messageID
|
|
||||||
// let content = result.content
|
|
||||||
// let extras = result.extras
|
|
||||||
// console.log("自定义消息", result)
|
|
||||||
// })
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
|
|
||||||
let that = this
|
let that = this
|
||||||
// 记录H5和公众号
|
// 记录H5和公众号
|
||||||
if (this.$store.state.app.token) {
|
if (this.$store.state.app.token) {
|
||||||
@ -257,112 +144,12 @@
|
|||||||
}, 1500)
|
}, 1500)
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
//网络检测
|
|
||||||
checknetwork() {
|
|
||||||
|
|
||||||
uni.onNetworkStatusChange(function(res) {
|
|
||||||
|
|
||||||
if (res.isConnected) {
|
|
||||||
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pages/index/index'
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
uni.showModal({
|
|
||||||
|
|
||||||
title: '系统提示',
|
|
||||||
|
|
||||||
content: '当前设备无网络或网络较差',
|
|
||||||
|
|
||||||
cancelText: '取消',
|
|
||||||
|
|
||||||
confirmText: '确定',
|
|
||||||
|
|
||||||
success: (res) => {
|
|
||||||
|
|
||||||
if (res.confirm) {
|
|
||||||
|
|
||||||
uni.reLaunch({
|
|
||||||
|
|
||||||
url: '/pages/index/index'
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/users/login/login_copy'
|
|
||||||
})
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
|
|
||||||
plus.runtime.quit()
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 语音播报
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
async audio() {
|
|
||||||
const innerAudioContext = uni.createInnerAudioContext();
|
|
||||||
innerAudioContext.autoplay = true;
|
|
||||||
innerAudioContext.src = `/static/audio/order.mp3`;
|
|
||||||
innerAudioContext.onPlay(() => {
|
|
||||||
console.log('开始播放')
|
|
||||||
});
|
|
||||||
innerAudioContext.onEnded(() => {
|
|
||||||
console.log('语音播报结束')
|
|
||||||
innerAudioContext.destroy() //销毁
|
|
||||||
if (this.audioTeam.length > 1) {
|
|
||||||
this.audioTeam.splice(0, 1);
|
|
||||||
console.log('队列中');
|
|
||||||
this.audio()
|
|
||||||
} else {
|
|
||||||
console.log('队列为零');
|
|
||||||
this.audioTeam = []
|
|
||||||
}
|
|
||||||
});
|
|
||||||
innerAudioContext.onError(() => {
|
|
||||||
console.log('语音播报失败')
|
|
||||||
innerAudioContext.destroy() // 销毁
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
// 微信分享;
|
// 微信分享;
|
||||||
setOpenShare: function(data) {
|
setOpenShare: function(data) {
|
||||||
// #ifdef H5
|
|
||||||
let that = this;
|
let that = this;
|
||||||
let href = location.href;
|
let href = location.href;
|
||||||
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this
|
href = href.indexOf("?") === -1 ? href + "?spid=" + this.globalData.uid : href + "&spid=" + this.globalData
|
||||||
.globalData
|
|
||||||
.uid;
|
.uid;
|
||||||
if (that.$wechat.isWeixin()) {
|
if (that.$wechat.isWeixin()) {
|
||||||
let configAppMessage = {
|
let configAppMessage = {
|
||||||
@ -371,10 +158,8 @@
|
|||||||
link: href,
|
link: href,
|
||||||
imgUrl: data.share_pic
|
imgUrl: data.share_pic
|
||||||
};
|
};
|
||||||
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"],
|
that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
|
||||||
configAppMessage);
|
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
// 获取配置
|
// 获取配置
|
||||||
getConfigData() {
|
getConfigData() {
|
||||||
@ -414,7 +199,6 @@
|
|||||||
this.globalData.community_reply_auth = res.data.community_reply_auth
|
this.globalData.community_reply_auth = res.data.community_reply_auth
|
||||||
this.globalData.margin_ico_switch = res.data.margin_ico_switch
|
this.globalData.margin_ico_switch = res.data.margin_ico_switch
|
||||||
this.globalData.margin_ico = res.data.margin_ico
|
this.globalData.margin_ico = res.data.margin_ico
|
||||||
// console.log(res.data.global_theme.theme + "我是")
|
|
||||||
this.$store.commit("VIEW_COLOR", res.data.global_theme.theme)
|
this.$store.commit("VIEW_COLOR", res.data.global_theme.theme)
|
||||||
this.$store.commit("KEY_COLOR", '_' + res.data.global_theme.type)
|
this.$store.commit("KEY_COLOR", '_' + res.data.global_theme.type)
|
||||||
try {
|
try {
|
||||||
@ -426,7 +210,7 @@
|
|||||||
this.setOpenShare(res.data);
|
this.setOpenShare(res.data);
|
||||||
// #endif
|
// #endif
|
||||||
}).catch(err => {});
|
}).catch(err => {});
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
//console.log('App Hide')
|
//console.log('App Hide')
|
||||||
@ -434,14 +218,12 @@
|
|||||||
watch: {
|
watch: {
|
||||||
// 记录H5和公众号
|
// 记录H5和公众号
|
||||||
$route(n) {
|
$route(n) {
|
||||||
// #ifdef H5
|
|
||||||
if (this.$store.state.app.token) {
|
if (this.$store.state.app.token) {
|
||||||
// 浏览记录
|
// 浏览记录
|
||||||
history({
|
history({
|
||||||
page: location.pathname + location.search,
|
page: location.pathname + location.search,
|
||||||
}).then(() => {});
|
}).then(() => {});
|
||||||
}
|
}
|
||||||
// #endif
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -452,11 +234,8 @@
|
|||||||
@import 'static/css/base.css';
|
@import 'static/css/base.css';
|
||||||
@import 'static/iconfont/iconfont.css';
|
@import 'static/iconfont/iconfont.css';
|
||||||
@import 'static/iconfont/iconlihai.css';
|
@import 'static/iconfont/iconlihai.css';
|
||||||
@import 'static/iconfont/icontan.css';
|
|
||||||
@import 'static/iconfont/demo.css';
|
|
||||||
@import 'static/css/style.scss';
|
@import 'static/css/style.scss';
|
||||||
|
|
||||||
|
|
||||||
view {
|
view {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
@ -480,17 +259,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: -50rpx;
|
margin-top: -40rpx;
|
||||||
// box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3);
|
// box-shadow: 0px 5px 10px 1px rgba(32, 161, 98, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom_style-txt {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 5rpx;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-color-red {
|
.bg-color-red {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"version" : "1",
|
"version" : "1",
|
||||||
"prompt" : "template",
|
"prompt" : "template",
|
||||||
"title" : "服务协议与隐私政策",
|
"title" : "服务协议与隐私政策",
|
||||||
"message" : "\t请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志、OAID等个 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。<br/>\r\r\t你可以阅读 <a href=\"https://shop.lihaink.cn/pages/users/user_about/index?from=sys_user_agree\">《用户协议》</a> 与 <a href=\"https://shop.lihaink.cn/pages/users/user_about/index?from=sys_userr_privacy\">《隐私政策》</a>了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。",
|
"message" : "\t请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志、OAID等个 人信息。你可以在“设置”中查看、变更、删除个人信息并管理你的授权。<br/>\r\r\t你可以阅读 < a href = \"https://shop.lihaink.cn/pages/users/user_about/index?from=sys_user_agree\">《用户协议》</a> 与 <a href=\"https://shop.lihaink.cn/pages/users/user_about/index?from=sys_userr_privacy\">《隐私政策》</a>了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。",
|
||||||
"buttonAccept" : "同意并接受",
|
"buttonAccept" : "同意并接受",
|
||||||
"buttonRefuse" : "暂不同意",
|
"buttonRefuse" : "暂不同意",
|
||||||
"second" : {
|
"second" : {
|
||||||
|
@ -262,52 +262,3 @@ export function spuTopList(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 活动列表
|
|
||||||
export function consumption(data) {
|
|
||||||
return request.get(`storeActivity/consumption`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 参加活动
|
|
||||||
export function chooseConsumption(data) {
|
|
||||||
return request.post(`storeActivity/choose`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 拉新红包活动完成状态
|
|
||||||
export function storeActivityStatus(data) {
|
|
||||||
return request.get(`storeActivity/status`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 领取红包
|
|
||||||
export function storeActivityReceive(data) {
|
|
||||||
return request.post(`storeActivity/receive`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 拉新红包活动完成状态
|
|
||||||
export function storeActivityRecord(data) {
|
|
||||||
return request.get(`storeActivity/record`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 红包余额统计
|
|
||||||
export function storeActivityTotal(data) {
|
|
||||||
return request.get(`storeActivity/total`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 生成二维码
|
|
||||||
export function storeActivityQrcode(data) {
|
|
||||||
return request.get(`qrcode`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 活动商品专区
|
|
||||||
export function storeActivityProduct(data) {
|
|
||||||
return request.get(`storeActivity/product`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 活动区域列表
|
|
||||||
export function storeActivityDistrict(data) {
|
|
||||||
return request.get(`storeActivity/district`, data);
|
|
||||||
}
|
|
||||||
|
125
api/admin.js
125
api/admin.js
@ -13,107 +13,68 @@ import request from "@/utils/request.js";
|
|||||||
* 统计数据
|
* 统计数据
|
||||||
*/
|
*/
|
||||||
export function getStatisticsInfo() {
|
export function getStatisticsInfo() {
|
||||||
return request.get("admin/order/statistics", {}, {
|
return request.get("admin/order/statistics", {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单月统计
|
* 订单月统计
|
||||||
*/
|
*/
|
||||||
export function getStatisticsMonth(where) {
|
export function getStatisticsMonth(where) {
|
||||||
return request.get("admin/order/data", where, {
|
return request.get("admin/order/data", where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单月统计
|
* 订单月统计
|
||||||
*/
|
*/
|
||||||
export function getAdminOrderList(where) {
|
export function getAdminOrderList(where) {
|
||||||
return request.get("admin/order/list", where, {
|
return request.get("admin/order/list", where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单改价
|
* 订单改价
|
||||||
*/
|
*/
|
||||||
export function setAdminOrderPrice(merId, id, data) {
|
export function setAdminOrderPrice(merId, id, data) {
|
||||||
return request.post("admin/" + merId + "/price/" + id, data, {
|
return request.post("admin/" + merId + "/price/" + id, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 同意先货后款
|
|
||||||
*/
|
|
||||||
export function postconfirm(merId, data) {
|
|
||||||
return request.post("admin/" + merId + "/confirm", data, {
|
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 先货后款订单结算
|
|
||||||
*/
|
|
||||||
export function postsettle(merId, data) {
|
|
||||||
return request.post("admin/" + merId + "/settle", data, {
|
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单备注
|
* 订单备注
|
||||||
*/
|
*/
|
||||||
export function setAdminOrderRemark(merId, id, data) {
|
export function setAdminOrderRemark(merId, id, data) {
|
||||||
return request.post("admin/" + merId + "/mark/" + id, data, {
|
return request.post("admin/" + merId + "/mark/" + id, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单详情
|
* 订单详情
|
||||||
*/
|
*/
|
||||||
export function getAdminOrderDetail(merId, orderId) {
|
export function getAdminOrderDetail(merId, orderId) {
|
||||||
return request.get("admin/" + merId + "/order/" + orderId, {}, {
|
return request.get("admin/" + merId + "/order/" + orderId, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单发货信息获取
|
* 订单发货信息获取
|
||||||
*/
|
*/
|
||||||
export function getAdminOrderDelivery(orderId) {
|
export function getAdminOrderDelivery(orderId) {
|
||||||
return request.get("admin/order/delivery/gain/" + orderId, {}, {
|
return request.get("admin/order/delivery/gain/" + orderId, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单发货保存
|
* 订单发货保存
|
||||||
*/
|
*/
|
||||||
export function setAdminOrderDelivery(merId, id, data) {
|
export function setAdminOrderDelivery(merId, id, data) {
|
||||||
return request.post("admin/" + merId + "/delivery/" + id, data, {
|
return request.post("admin/" + merId + "/delivery/" + id, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单统计图
|
* 订单统计图
|
||||||
*/
|
*/
|
||||||
export function getStatisticsTime(data) {
|
export function getStatisticsTime(data) {
|
||||||
return request.get("admin/order/time", data, {
|
return request.get("admin/order/time", data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 线下付款订单确认付款
|
* 线下付款订单确认付款
|
||||||
*/
|
*/
|
||||||
export function setOfflinePay(merId, data) {
|
export function setOfflinePay(merId, data) {
|
||||||
return request.post("admin/" + merId + "/order/offline", data, {
|
return request.post("admin/" + merId + "/order/offline", data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单确认退款
|
* 订单确认退款
|
||||||
*/
|
*/
|
||||||
export function setOrderRefund(merId, data) {
|
export function setOrderRefund(merId, data) {
|
||||||
return request.post("admin/" + merId + "/order/refund", data, {
|
return request.post("admin/" + merId + "/order/refund", data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -121,9 +82,7 @@ export function setOrderRefund(merId, data) {
|
|||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function getLogistics() {
|
export function getLogistics() {
|
||||||
return request.get("logistics", {}, {
|
return request.get("logistics", {}, { login: false });
|
||||||
login: false
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,57 +108,40 @@ export function verifierOrder(mer_id, code) {
|
|||||||
export function orderStatistics(mer_id, data) {
|
export function orderStatistics(mer_id, data) {
|
||||||
return request.get("admin/" + mer_id + "/statistics", data);
|
return request.get("admin/" + mer_id + "/statistics", data);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 订单
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function orderStat(data) {
|
|
||||||
return request.get("admin/1/statistics", data);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 每日成交额
|
* 每日成交额
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function orderPrice(where, mer_id) {
|
export function orderPrice(where, mer_id) {
|
||||||
return request.get("admin/" + mer_id + "/order_price", where, {
|
return request.get("admin/" + mer_id + "/order_price", where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单列表
|
* 订单列表
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function getOrderList(where, merId) {
|
export function getOrderList(where, merId) {
|
||||||
return request.get(`admin/${merId}/order_list`, where, {
|
return request.get(`admin/${merId}/order_list`, where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 退款订单列表
|
* 退款订单列表
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function getRefundOrderList(where, merId) {
|
export function getRefundOrderList(where, merId) {
|
||||||
return request.get(`server/${merId}/refund/lst`, where, {
|
return request.get(`server/${merId}/refund/lst`, where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 营业额统计
|
* 营业额统计
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function turnoverStatistics(where, merId) {
|
export function turnoverStatistics(where, merId) {
|
||||||
return request.get(`admin/${merId}/pay_price`, where, {
|
return request.get(`admin/${merId}/pay_price`, where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 订单统计
|
* 订单统计
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function orderNumberStatistics(where, merId) {
|
export function orderNumberStatistics(where, merId) {
|
||||||
return request.get(`admin/${merId}/pay_number`, where, {
|
return request.get(`admin/${merId}/pay_number`, where, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获取订单打印默认配置
|
* 获取订单打印默认配置
|
||||||
@ -241,34 +183,26 @@ export function getRefundOrderInfo(merId, id) {
|
|||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function refundOrderSubmit(merId, id, data) {
|
export function refundOrderSubmit(merId, id, data) {
|
||||||
return request.post(`server/${merId}/refund/status/${id}`, data, {
|
return request.post(`server/${merId}/refund/status/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 退款单确认收货
|
* 退款单确认收货
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function refundOrderReceive(merId, id) {
|
export function refundOrderReceive(merId, id) {
|
||||||
return request.post(`server/${merId}/refund/confirm/${id}`, {}, {
|
return request.post(`server/${merId}/refund/confirm/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 退款单详情
|
* 退款单详情
|
||||||
*/
|
*/
|
||||||
export function getRefundOrderDetail(merId, orderId) {
|
export function getRefundOrderDetail(merId, orderId) {
|
||||||
return request.get(`server/${merId}/refund/detail/${orderId}`, {}, {
|
return request.get(`server/${merId}/refund/detail/${orderId}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 添加退款单备注信息
|
* 添加退款单备注信息
|
||||||
*/
|
*/
|
||||||
export function setRefundMark(merId, orderId, data) {
|
export function setRefundMark(merId, orderId, data) {
|
||||||
return request.post(`server/${merId}/refund/mark/${orderId}`, data, {
|
return request.post(`server/${merId}/refund/mark/${orderId}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 去核销
|
* 去核销
|
||||||
@ -277,20 +211,3 @@ export function setRefundMark(merId, orderId, data) {
|
|||||||
export function orderCancellation(merId, id) {
|
export function orderCancellation(merId, id) {
|
||||||
return request.post(`admin/${merId}/verify/${id}`);
|
return request.post(`admin/${merId}/verify/${id}`);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 去核销
|
|
||||||
* @param object data
|
|
||||||
*/
|
|
||||||
export function purchaseOrder(where, merId) {
|
|
||||||
return request.get(`admin/${merId}/purchaseOrder`, where, {
|
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商家物流取件二维码
|
|
||||||
* @param object data
|
|
||||||
*/
|
|
||||||
export function logisticsCode(id) {
|
|
||||||
return request.get(`order/logistics_code/${id}`);
|
|
||||||
}
|
|
52
api/api.js
52
api/api.js
@ -5,17 +5,8 @@ import request from "@/utils/request.js";
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function cloudWarehouse(data) {
|
export function cloudWarehouse(data) {
|
||||||
return request.get("store/product/cloudWarehouse", data, { noAuth: true });
|
return request.get("store/product/cloudWarehouse", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 为你推荐
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function spuRecommend(data) {
|
|
||||||
return request.get("product/spu/recommend", data, { noAuth: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取云仓分类
|
* 获取云仓分类
|
||||||
*
|
*
|
||||||
@ -112,10 +103,6 @@ export function getUserCoupons(data) {
|
|||||||
export function getArticleCategoryList() {
|
export function getArticleCategoryList() {
|
||||||
return request.get('article/category/lst', {}, { noAuth: true })
|
return request.get('article/category/lst', {}, { noAuth: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getArticleCategoryLists() {
|
|
||||||
return request.get('article/category/lst?is_home='+1, {}, { noAuth: true })
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 文章列表
|
* 文章列表
|
||||||
* @param int cid
|
* @param int cid
|
||||||
@ -282,40 +269,3 @@ export function ajcaptchaCheck(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所在的地区数据
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
export function village(data) {
|
|
||||||
return request.get('v2/system/geo/lst', data, { noAuth: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所在的村队数据
|
|
||||||
* @param {Object} data
|
|
||||||
*/
|
|
||||||
export function brigade(data) {
|
|
||||||
return request.get('v2/system/brigade', data, { noAuth: true });
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
生产 -- 获取商户押金信息支付接口
|
|
||||||
*/
|
|
||||||
export function paymerchant() {
|
|
||||||
return request.post(`user/margin`,{});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
生产 -- 获取商户押金信息接口
|
|
||||||
*/
|
|
||||||
export function merchant(data) {
|
|
||||||
return request.get(`store/merchant/margin`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取押金缴纳列表
|
|
||||||
export function marginlist(data) {
|
|
||||||
return request.get(`user/margin/list`,data);
|
|
||||||
}
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import request from "@/utils/requesta.js";
|
import request from "@/utils/request.js";
|
||||||
|
|
||||||
/** 获取话题分类*/
|
/** 获取话题分类*/
|
||||||
export function getTopicList() {
|
export function getTopicList() {
|
||||||
@ -82,18 +82,11 @@ export function videoList(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**自己的视频列表*/
|
/**自己的视频列表*/
|
||||||
export function deoList(id) {
|
|
||||||
return request.get(`community/show/${id}`, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function myVideoList(id,data) {
|
export function myVideoList(id,data) {
|
||||||
return request.get(`community/user/community_video/${id}`, data, {
|
return request.get(`community/user/community_video/${id}`, data, {
|
||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**文章点赞*/
|
/**文章点赞*/
|
||||||
export function graphicStartApi(id, status) {
|
export function graphicStartApi(id, status) {
|
||||||
return request.post(`community/start/${id}`, status);
|
return request.post(`community/start/${id}`, status);
|
||||||
|
151
api/live.js
151
api/live.js
@ -1,151 +0,0 @@
|
|||||||
import request from "@/utils/requestc.js";
|
|
||||||
import requesta from "@/utils/request.js";
|
|
||||||
/**
|
|
||||||
* 直播列表
|
|
||||||
*/
|
|
||||||
export function live(data) {
|
|
||||||
return request.get("zhibo/live" ,data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 直播详情
|
|
||||||
*/
|
|
||||||
export function liveDetail(data) {
|
|
||||||
return request.get("zhibo/liveDetail" ,data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取直播详情接口
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建直播间
|
|
||||||
*/
|
|
||||||
export function createPushLive(data) {
|
|
||||||
return request.post("zhibo/createPushLive", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭直播间
|
|
||||||
*/
|
|
||||||
export function stopPushLive(data) {
|
|
||||||
return request.post("zhibo/stopPushLive", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定用户client客户
|
|
||||||
*/
|
|
||||||
export function bindUser(data) {
|
|
||||||
return request.post("zhibo/bindUser", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加入直播间聊天室
|
|
||||||
*/
|
|
||||||
export function joinChatRoom(data) {
|
|
||||||
return request.post("zhibo/joinChatRoom", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 直播间聊天室发言
|
|
||||||
*/
|
|
||||||
export function sendGroupMessage(data) {
|
|
||||||
return request.post("zhibo/sendGroupMessage", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//商品列表
|
|
||||||
export function good(data) {
|
|
||||||
return requesta.get("product/spu/lst", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户信息
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getUserInfo() {
|
|
||||||
return request.get('user');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//关注
|
|
||||||
export function getfans(id,data) {
|
|
||||||
return requesta.post('community/fans/'+id,data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//我关注的人
|
|
||||||
export function getfocuslst(data) {
|
|
||||||
return requesta.post('community/focus/lst',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//关注我的人
|
|
||||||
export function getfanslst(data) {
|
|
||||||
return requesta.get('community/fans/lst',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//用户送礼
|
|
||||||
export function reward(data) {
|
|
||||||
return request.post('zhibo/reward',data);
|
|
||||||
}
|
|
||||||
//获取礼物
|
|
||||||
export function rewardList(data) {
|
|
||||||
return requesta.get('zhibo/rewardList',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取礼物
|
|
||||||
export function giftList(data) {
|
|
||||||
return request.get('zhibo/giftList',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取房间人数
|
|
||||||
export function liveAudience(data) {
|
|
||||||
return request.get('zhibo/liveAudience',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取用户余额
|
|
||||||
export function getuser(data) {
|
|
||||||
return requesta.get('user',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//送礼
|
|
||||||
export function sendGift(data) {
|
|
||||||
return request.post('zhibo/sendGift',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//获取主播关注人数
|
|
||||||
export function fansNum(data) {
|
|
||||||
return requesta.get('zhibo/fansNum',data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 充值金额选择
|
|
||||||
*/
|
|
||||||
export function getRechargeApi() {
|
|
||||||
return requesta.get("common/recharge_quota");
|
|
||||||
}
|
|
||||||
|
|
||||||
//历史直播记录
|
|
||||||
|
|
||||||
export function playbackList(data) {
|
|
||||||
return request.get("zhibo/playbackList",data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取直播回放详情
|
|
||||||
export function playbackDetail(data) {
|
|
||||||
return request.get("zhibo/playbackDetail",data);
|
|
||||||
}
|
|
||||||
//获取观众关注主播状态
|
|
||||||
export function getAjuser(id) {
|
|
||||||
return requesta.get(`community/user/info/${id}`);
|
|
||||||
}
|
|
16
api/order.js
16
api/order.js
@ -107,7 +107,7 @@ export function orderDel(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已付款订单详情
|
* 订单详情
|
||||||
* @param string uni
|
* @param string uni
|
||||||
*/
|
*/
|
||||||
export function getOrderDetail(uni) {
|
export function getOrderDetail(uni) {
|
||||||
@ -115,11 +115,11 @@ export function getOrderDetail(uni) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 未付款订单详情
|
* 订单详情
|
||||||
* @param string uni
|
* @param string uni
|
||||||
*/
|
*/
|
||||||
export function groupOrderDetail(uni,product_type) {
|
export function groupOrderDetail(uni) {
|
||||||
return request.get('order/group_order_detail/' + uni+'?product_type=' + product_type);
|
return request.get('order/group_order_detail/' + uni);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 支付状态订单
|
// 支付状态订单
|
||||||
@ -327,11 +327,3 @@ export function applyInvoiceApi(id, data) {
|
|||||||
export function refundCancelApi(id) {
|
export function refundCancelApi(id) {
|
||||||
return request.post(`refund/cancel/${id}`);
|
return request.post(`refund/cancel/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 售后
|
|
||||||
* @param object data
|
|
||||||
*/
|
|
||||||
export function refundlist(data) {
|
|
||||||
return request.get(`refund/list`,data);
|
|
||||||
}
|
|
158
api/product.js
158
api/product.js
@ -14,18 +14,6 @@ import request from "@/utils/request.js";
|
|||||||
*/
|
*/
|
||||||
export const getProductDetailsAPI = (data) => request.get('micro/product_details', data)
|
export const getProductDetailsAPI = (data) => request.get('micro/product_details', data)
|
||||||
|
|
||||||
/**
|
|
||||||
*商品列表
|
|
||||||
*/
|
|
||||||
export const spuInfo = (id, data) => request.get('product/spu/street/' + id, data)
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 线下导入
|
|
||||||
*/
|
|
||||||
export function postImport(merid, data) {
|
|
||||||
return request.post(`server/${merid}/product/stockIn`, data);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取商户基本信息 http://127.0.0.1:8324/api/store/merchant/info?id=4
|
* 获取商户基本信息 http://127.0.0.1:8324/api/store/merchant/info?id=4
|
||||||
*/
|
*/
|
||||||
@ -38,26 +26,20 @@ export const merchantUpdateAPI = (data) => request.post('store/merchant/update',
|
|||||||
* 商品列表
|
* 商品列表
|
||||||
*/
|
*/
|
||||||
export function productLstApi(merId, data) {
|
export function productLstApi(merId, data) {
|
||||||
return request.get(`server/${merId}/product/lst`, data, {
|
return request.get(`server/${merId}/product/lst`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品列表 -- 删除
|
* 商品列表 -- 删除
|
||||||
*/
|
*/
|
||||||
export function productDeleteApi(merId, id) {
|
export function productDeleteApi(merId, id) {
|
||||||
return request.post(`server/${merId}/product/delete/${id}`, {}, {
|
return request.post(`server/${merId}/product/delete/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品列表 -- 上下架
|
* 商品列表 -- 上下架
|
||||||
*/
|
*/
|
||||||
export function productOffApi(merId, id, data) {
|
export function productOffApi(merId, id, data) {
|
||||||
return request.post(`server/${merId}/product/status/${id}`, data, {
|
return request.post(`server/${merId}/product/status/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -65,9 +47,7 @@ export function productOffApi(merId, id, data) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function productTitle(merId, data) {
|
export function productTitle(merId, data) {
|
||||||
return request.get(`server/${merId}/product/title`, data, {
|
return request.get(`server/${merId}/product/title`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -75,9 +55,7 @@ export function productTitle(merId, data) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function productDestory(merId, id, data) {
|
export function productDestory(merId, id, data) {
|
||||||
return request.post(`server/${merId}/product/destory/${id}`, data, {
|
return request.post(`server/${merId}/product/destory/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -85,9 +63,7 @@ export function productDestory(merId, id, data) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function productRestore(merId, id) {
|
export function productRestore(merId, id) {
|
||||||
return request.post(`server/${merId}/product/restore/${id}`, {}, {
|
return request.post(`server/${merId}/product/restore/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -95,9 +71,7 @@ export function productRestore(merId, id) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function categoryBrandlist(merId) {
|
export function categoryBrandlist(merId) {
|
||||||
return request.get(`server/${merId}/category/brandlist`, {}, {
|
return request.get(`server/${merId}/category/brandlist`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -105,9 +79,7 @@ export function categoryBrandlist(merId) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function categorySelect(merId) {
|
export function categorySelect(merId) {
|
||||||
return request.get(`server/${merId}/category/select`, {}, {
|
return request.get(`server/${merId}/category/select`, {}, { login: true })
|
||||||
login: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -115,9 +87,7 @@ export function categorySelect(merId) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function categoryList(merId) {
|
export function categoryList(merId) {
|
||||||
return request.get(`server/${merId}/category/list`, {}, {
|
return request.get(`server/${merId}/category/list`, {}, { login: true })
|
||||||
login: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -125,17 +95,13 @@ export function categoryList(merId) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function productCreate(merId, data) {
|
export function productCreate(merId, data) {
|
||||||
return request.post(`server/${merId}/product/create`, data, {
|
return request.post(`server/${merId}/product/create`, data, { login: true })
|
||||||
login: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品列表 -- 设置推荐
|
* 商品列表 -- 设置推荐
|
||||||
*/
|
*/
|
||||||
export function productRecommendApi(merId, id, data) {
|
export function productRecommendApi(merId, id, data) {
|
||||||
return request.post(`server/${merId}/product/good/${id}`, data, {
|
return request.post(`server/${merId}/product/good/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -143,181 +109,119 @@ export function productRecommendApi(merId, id, data) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export function attrList(merId, data) {
|
export function attrList(merId, data) {
|
||||||
return request.get(`server/${merId}/attr/lst`, data, {
|
return request.get(`server/${merId}/attr/lst`, data, { login: true })
|
||||||
login: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
请求运费模板
|
请求运费模板
|
||||||
*/
|
*/
|
||||||
export function templateList(merId, data) {
|
export function templateList(merId, data) {
|
||||||
return request.get(`server/${merId}/template/lst`, data, {
|
return request.get(`server/${merId}/template/lst`, data, { login: true })
|
||||||
login: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
运费模板 -- 删除
|
运费模板 -- 删除
|
||||||
*/
|
*/
|
||||||
export function templateDelete(merId, data) {
|
export function templateDelete(merId, data) {
|
||||||
return request.post(`server/${merId}/template/delete`, data, {
|
return request.post(`server/${merId}/template/delete`, data, { login: true })
|
||||||
login: true
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 运费模板 -- 详情
|
* 运费模板 -- 详情
|
||||||
*/
|
*/
|
||||||
export function templateDetail(merId, id) {
|
export function templateDetail(merId, id) {
|
||||||
return request.get(`server/${merId}/template/detail/${id}`, {}, {
|
return request.get(`server/${merId}/template/detail/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
运费模板 -- 添加
|
运费模板 -- 添加
|
||||||
*/
|
*/
|
||||||
export function templateCreate(merId, data) {
|
export function templateCreate(merId, data) {
|
||||||
return request.post(`server/${merId}/template/create`, data, {
|
return request.post(`server/${merId}/template/create`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
运费模板 -- 编辑
|
运费模板 -- 编辑
|
||||||
*/
|
*/
|
||||||
export function templateUpdate(merId, id, data) {
|
export function templateUpdate(merId, id, data) {
|
||||||
return request.post(`server/${merId}/template/update/${id}`, data, {
|
return request.post(`server/${merId}/template/update/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 店铺分类 -- 列表
|
* 店铺分类 -- 列表
|
||||||
*/
|
*/
|
||||||
export function storeClassifyLst(merId) {
|
export function storeClassifyLst(merId) {
|
||||||
return request.get(`server/${merId}/category/lst`, {}, {
|
return request.get(`server/${merId}/category/lst`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 店铺分类 -- 列表(删除)
|
* 店铺分类 -- 列表(删除)
|
||||||
*/
|
*/
|
||||||
export function storeClassifyDel(merId, id) {
|
export function storeClassifyDel(merId, id) {
|
||||||
return request.post(`server/${merId}/category/delete/${id}`, {}, {
|
return request.post(`server/${merId}/category/delete/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 上级分类 -- 商户列表
|
* 上级分类 -- 商户列表
|
||||||
*/
|
*/
|
||||||
export function merClassifyLst(merId) {
|
export function merClassifyLst(merId) {
|
||||||
return request.get(`server/${merId}/category/select`, {}, {
|
return request.get(`server/${merId}/category/select`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 店铺分类 -- 添加
|
* 店铺分类 -- 添加
|
||||||
*/
|
*/
|
||||||
export function merClassifyAdd(merId, data) {
|
export function merClassifyAdd(merId, data) {
|
||||||
return request.post(`server/${merId}/category/create`, data, {
|
return request.post(`server/${merId}/category/create`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 店铺分类 -- 详情
|
* 店铺分类 -- 详情
|
||||||
*/
|
*/
|
||||||
export function merClassifyDetail(merId, id) {
|
export function merClassifyDetail(merId, id) {
|
||||||
return request.get(`server/${merId}/category/detail/${id}`, {}, {
|
return request.get(`server/${merId}/category/detail/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 店铺分类 -- 编辑
|
* 店铺分类 -- 编辑
|
||||||
*/
|
*/
|
||||||
export function merClassifyUpdate(merId, id, data) {
|
export function merClassifyUpdate(merId, id, data) {
|
||||||
return request.post(`server/${merId}/category/update/${id}`, data, {
|
return request.post(`server/${merId}/category/update/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品规格项目 -- 列表
|
* 商品规格项目 -- 列表
|
||||||
*/
|
*/
|
||||||
export function specificationLst(merId, data) {
|
export function specificationLst(merId, data) {
|
||||||
return request.get(`server/${merId}/attr/lst`, data, {
|
return request.get(`server/${merId}/attr/lst`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品规格项目 -- 删除
|
* 商品规格项目 -- 删除
|
||||||
*/
|
*/
|
||||||
export function specificationDel(merId, data) {
|
export function specificationDel(merId, data) {
|
||||||
return request.post(`server/${merId}/attr/delete`, data, {
|
return request.post(`server/${merId}/attr/delete`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品规格项目 -- 添加
|
* 商品规格项目 -- 添加
|
||||||
*/
|
*/
|
||||||
export function specificationAdd(merId, data) {
|
export function specificationAdd(merId, data) {
|
||||||
return request.post(`server/${merId}/attr/create`, data, {
|
return request.post(`server/${merId}/attr/create`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品规格项目 -- 编辑
|
* 商品规格项目 -- 编辑
|
||||||
*/
|
*/
|
||||||
export function specificationUpdate(merId, id, data) {
|
export function specificationUpdate(merId, id, data) {
|
||||||
return request.post(`server/${merId}/attr/update/${id}`, data, {
|
return request.post(`server/${merId}/attr/update/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 商品规格项目 -- 详情
|
* 商品规格项目 -- 详情
|
||||||
*/
|
*/
|
||||||
export function specificationDetail(merId, id) {
|
export function specificationDetail(merId, id) {
|
||||||
return request.get(`server/${merId}/attr/detail/${id}`, {}, {
|
return request.get(`server/${merId}/attr/detail/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
请求商品详情
|
请求商品详情
|
||||||
*/
|
*/
|
||||||
export function productDetail(merId, id) {
|
export function productDetail(merId, id) {
|
||||||
return request.get(`server/${merId}/product/detail/${id}`, {}, {
|
return request.get(`server/${merId}/product/detail/${id}`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
编辑商品
|
编辑商品
|
||||||
*/
|
*/
|
||||||
export function productUpdate(merId, id, data) {
|
export function productUpdate(merId, id, data) {
|
||||||
return request.post(`server/${merId}/product/update/${id}`, data, {
|
return request.post(`server/${merId}/product/update/${id}`, data, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
添加商品 -- 获取送货方式信息
|
添加商品 -- 获取送货方式信息
|
||||||
*/
|
*/
|
||||||
export function getDeliveryType(merId) {
|
export function getDeliveryType(merId) {
|
||||||
return request.get(`server/${merId}/product/config`, {}, {
|
return request.get(`server/${merId}/product/config`, {}, { login: true });
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
商品 -- 获取交易协议内容
|
|
||||||
*/
|
|
||||||
export function business(data) {
|
|
||||||
return request.get(`business/agree`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
商品 -- 获取交易申请记录
|
|
||||||
*/
|
|
||||||
export function intention(data) {
|
|
||||||
return request.get(`intention/lst`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
商品 -- 同意提交申请
|
|
||||||
*/
|
|
||||||
export function intentionbus(data) {
|
|
||||||
return request.post(`intention/business`, data);
|
|
||||||
}
|
}
|
@ -24,7 +24,6 @@ export function getWechatConfig() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取微信sdk配置
|
* 获取微信sdk配置
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
@ -75,16 +74,6 @@ export function bindMp(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 绑定极光id
|
|
||||||
* @param data object 小程序用户登陆信息
|
|
||||||
*/
|
|
||||||
export function bindJG(data) {
|
|
||||||
return request.post("auth/bindJg", data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分享
|
* 分享
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
@ -142,11 +131,3 @@ export function getNavigation(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
小程序 -- 小程序列表
|
|
||||||
*/
|
|
||||||
export function applet(data) {
|
|
||||||
return request.get(`applet`, data);
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
// +----------------------------------------------------------------------
|
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
import request from "@/utils/request.js";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取发布管理转售商品列表
|
|
||||||
* @param numType boolean true 购物车数量,false=购物车产品数量
|
|
||||||
*/
|
|
||||||
export function getResale(data) {
|
|
||||||
return request.get("community/resale/lst", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清除发布管理转售商品
|
|
||||||
* @param object ids
|
|
||||||
*/
|
|
||||||
export function getResaledelete(id) {
|
|
||||||
return request.post('community/resale/delete/'+ id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户是否同意转售商品折扣价
|
|
||||||
* @param object ids
|
|
||||||
*/
|
|
||||||
export function getResalecheck(id,data) {
|
|
||||||
return request.post('community/resale/check/'+ id,data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取转售商品详情
|
|
||||||
* @param object ids
|
|
||||||
*/
|
|
||||||
export function getResaleid(id) {
|
|
||||||
return request.get('community/resale/' + id);
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
import request from "@/utils/requesta.js";
|
|
||||||
|
|
||||||
export function getCityCloundShop(data) {
|
|
||||||
return request.get("city/get_cloud_shop", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getCategoryListLevel(data) {
|
|
||||||
return request.get("category/list_level", data);
|
|
||||||
}
|
|
||||||
export function cloudWarehouse(data) {
|
|
||||||
return request.get("store/product/cloudWarehouse", data);
|
|
||||||
}
|
|
||||||
export function townCloud(data) {
|
|
||||||
return request.get("store/product/town_cloud", data);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 供销市场标签
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function supMenuApi(data) {
|
|
||||||
return request.get('intention/v2/cate', data);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取购物车列表
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCartList(data) {
|
|
||||||
return request.get("user/cart/lst", data);
|
|
||||||
}
|
|
||||||
export function getCartCounts(data) {
|
|
||||||
return request.get("user/cart/count", data);
|
|
||||||
}
|
|
56
api/sale.js
56
api/sale.js
@ -1,56 +0,0 @@
|
|||||||
// +----------------------------------------------------------------------
|
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
import request from "@/utils/request.js";
|
|
||||||
|
|
||||||
//发布委托商品选择 供应链商家接口
|
|
||||||
export function supplychain(data) {
|
|
||||||
return request.get("community/supplychain/list", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//普通商家发布委托商品
|
|
||||||
export function entrustchain(data) {
|
|
||||||
return request.post("community/entrust", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//获取委托商品列表
|
|
||||||
export function entrustlist(data) {
|
|
||||||
return request.get("community/entrust/list", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//供应链商家是否同意委托
|
|
||||||
export function checkchain(id,data) {
|
|
||||||
return request.post("community/entrust/check/"+id, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//供应链商家申请结束委托
|
|
||||||
export function finishchain(id,data) {
|
|
||||||
return request.post("community/entrust/apply/finish/"+id, data);
|
|
||||||
}
|
|
||||||
//商家申请结束委托
|
|
||||||
export function finishentrust(id,data) {
|
|
||||||
return request.post("community/entrust/finish/"+id, data);
|
|
||||||
}
|
|
||||||
//委托商品加入购物车
|
|
||||||
export function addEntrustCart(data) {
|
|
||||||
return request.post("community/entrust/addEntrustCart", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//获取委托商品详情
|
|
||||||
export function entrustdetail(id) {
|
|
||||||
return request.get("community/entrust/"+id);
|
|
||||||
}
|
|
||||||
|
|
||||||
//编辑委托商品详情
|
|
||||||
export function editentrust(id,data) {
|
|
||||||
return request.post("community/entrust/edit/"+id, data);
|
|
||||||
}
|
|
67
api/store.js
67
api/store.js
@ -1,5 +1,4 @@
|
|||||||
import request from "@/utils/request.js";
|
import request from "@/utils/request.js";
|
||||||
import requestb from "@/utils/requestb.js";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 扫码查询商品
|
* 扫码查询商品
|
||||||
@ -373,14 +372,6 @@ export function getHotBanner(type) {
|
|||||||
export function create(data) {
|
export function create(data) {
|
||||||
return request.post("intention/create", data);
|
return request.post("intention/create", data);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 个人入驻表单
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function personalStore(data) {
|
|
||||||
return request.post("intention/personal_store", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商户入驻短信验证码
|
* 商户入驻短信验证码
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
@ -476,9 +467,7 @@ export function getGeocoder(data) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export function getStoreTypeApi() {
|
export function getStoreTypeApi() {
|
||||||
return request.get('intention/type', {
|
return request.get('intention/type', {}, {
|
||||||
sift_store: 0
|
|
||||||
}, {
|
|
||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -555,57 +544,3 @@ export function priceRuleApi(id) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 供销市场标签
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function supMenuApi(data) {
|
|
||||||
return request.get('intention/v2/cate', data);
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 供销市场标签
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export function supAgoodsApi(data) {
|
|
||||||
return request.get('store/merchant/lst', data);
|
|
||||||
}
|
|
||||||
// /api/store / merchant / lst ? page = 1 & limit = 10 & order = & category_id = 22 & type_id = 10 & street_id = &
|
|
||||||
// credit_buy =
|
|
||||||
// /api/region/:street_id/merchant
|
|
||||||
/**
|
|
||||||
* 附近商家
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
// export function supAgoodsApi(data) {
|
|
||||||
// return request.get('store/merchant/lst', data);
|
|
||||||
// }
|
|
||||||
export function vicinityStoreApi(data) {
|
|
||||||
return request.get(`region/${data}/merchant`);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
商家入驻 -- 获取商户入驻申请协议内容
|
|
||||||
*/
|
|
||||||
export function agreeiness(data) {
|
|
||||||
return request.get(`business/agree`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
上传图片识别文字
|
|
||||||
*/
|
|
||||||
export function merchantLicenseIdentify(data) {
|
|
||||||
return request.post(`merchant_license_identify`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
从供销平台获取村店铺负责人,联系电话
|
|
||||||
*/
|
|
||||||
export function getVillageInfo(data) {
|
|
||||||
return requestb.get(`shop_call/getVillageCompany`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,88 +0,0 @@
|
|||||||
// +----------------------------------------------------------------------
|
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
import request from "@/utils/request.js";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调货列表
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCommunityList(data) {
|
|
||||||
return request.get('community/lst', data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 商品详情
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCommunityshow(data) {
|
|
||||||
|
|
||||||
return request.get('community/show/' + data, {}, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 可转售的订单列表
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCommunitygetOrderList(data) {
|
|
||||||
return request.get('community/product/lst', data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发起转售
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCommunitycreate(data) {
|
|
||||||
return request.post(`community/create`, data, {
|
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改转售
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCommunityUpdate(data) {
|
|
||||||
return request.post(`community/update`, data, {
|
|
||||||
login: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 加入购物车
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export function getCommunityaddCart(data) {
|
|
||||||
return request.post('community/addCart', data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//商品宝贝详情
|
|
||||||
|
|
||||||
export function getProductDetail(id) {
|
|
||||||
return request.get('store/product/detail/' + id,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
//获取转售商品详情
|
|
||||||
export function getresaleDetail(id) {
|
|
||||||
return request.get('community/resale/' + id,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//编辑转售商品
|
|
||||||
export function getresaleEdit(id,data) {
|
|
||||||
return request.post('community/resale/edit/' + id,data
|
|
||||||
);
|
|
||||||
}
|
|
27
api/uniMP.js
27
api/uniMP.js
@ -1,27 +0,0 @@
|
|||||||
// +----------------------------------------------------------------------
|
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
import request from "@/utils/request.js";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取供销平台版本信息
|
|
||||||
*/
|
|
||||||
export function getGXconfig(data) {
|
|
||||||
return request.get("global/config", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商城小程序信息
|
|
||||||
*/
|
|
||||||
|
|
||||||
export function miniapp(data) {
|
|
||||||
return request.get("miniapp/version?version=1", data);
|
|
||||||
}
|
|
||||||
|
|
42
api/user.js
42
api/user.js
@ -8,17 +8,7 @@
|
|||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import request from "@/utils/request.js";
|
import request from "@/utils/request.js";
|
||||||
|
|
||||||
import request1 from "@/utils/requestb.js";
|
|
||||||
import Cache from '@/utils/cache'
|
import Cache from '@/utils/cache'
|
||||||
/**
|
|
||||||
* 获取版本信息
|
|
||||||
*/
|
|
||||||
export function Appversion(data) {
|
|
||||||
return request.get(`app/version`, data, {
|
|
||||||
noAuth: true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 提交提现
|
* 提交提现
|
||||||
*/
|
*/
|
||||||
@ -31,12 +21,6 @@ export function postCreateApplyAPI(merId, data) {
|
|||||||
export function getAdminApplyAPI(merId, data) {
|
export function getAdminApplyAPI(merId, data) {
|
||||||
return request.get(`admin/${merId}/apply`, data);
|
return request.get(`admin/${merId}/apply`, data);
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* 提现记录
|
|
||||||
*/
|
|
||||||
export function getAdminApplyListAPI(merId) {
|
|
||||||
return request.get(`admin/${merId}/lis_apply`);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* 获取用户信息
|
* 获取用户信息
|
||||||
*
|
*
|
||||||
@ -101,6 +85,15 @@ export function registerVerify(data) {
|
|||||||
noAuth: true
|
noAuth: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* h5用户发送验证码(本地滑动验证)
|
||||||
|
* @param data object 用户手机号
|
||||||
|
*/
|
||||||
|
export function verifyCode(data) {
|
||||||
|
return request.post("auth/verifyCode", data, {
|
||||||
|
noAuth: true
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* h5用户手机号注册
|
* h5用户手机号注册
|
||||||
* @param data object 用户手机号 验证码 密码
|
* @param data object 用户手机号 验证码 密码
|
||||||
@ -718,20 +711,3 @@ export function hasServiceApi(id) {
|
|||||||
export function getBankInfo() {
|
export function getBankInfo() {
|
||||||
return request.get(`user/extract/history_bank`)
|
return request.get(`user/extract/history_bank`)
|
||||||
}
|
}
|
||||||
// 商户账单管理
|
|
||||||
export function getBillDetil() {
|
|
||||||
return request.get(`mer/financial_record`)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//获取商户入驻所签署公司
|
|
||||||
|
|
||||||
export function merstreet(data) {
|
|
||||||
return request1.get(`company/street_company`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
//填写邀请码
|
|
||||||
export function bindPromotionCode(data) {
|
|
||||||
return request.post(`user/change/bind_promotion_code`, data)
|
|
||||||
}
|
|
@ -28,8 +28,7 @@
|
|||||||
<view class='bottom flex'>
|
<view class='bottom flex'>
|
||||||
<text class='item' @click='close'>随便逛逛</text>
|
<text class='item' @click='close'>随便逛逛</text>
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
<button class="item grant" hover-class="none" @tap="getUserProfile"><text
|
<button class="item grant" hover-class="none" @tap="getUserProfile"><text class="text">去授权</text></button>
|
||||||
class="text">去授权</text></button>
|
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<button class="item grant" @tap="toWecahtAuth">
|
<button class="item grant" @tap="toWecahtAuth">
|
||||||
@ -56,22 +55,12 @@
|
|||||||
getLogo,
|
getLogo,
|
||||||
commonAuth
|
commonAuth
|
||||||
} from '../api/public';
|
} from '../api/public';
|
||||||
import {
|
import { LOGO_URL, USER_INFO, EXPIRES_TIME } from '../config/cache';
|
||||||
LOGO_URL,
|
import { mapGetters } from 'vuex';
|
||||||
USER_INFO,
|
|
||||||
EXPIRES_TIME
|
|
||||||
} from '../config/cache';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from 'vuex';
|
|
||||||
import Routine from '../libs/routine';
|
import Routine from '../libs/routine';
|
||||||
import {
|
import { configMap } from '@/utils/index';
|
||||||
configMap
|
|
||||||
} from '@/utils/index';
|
|
||||||
import Auth from '../libs/wechat';
|
import Auth from '../libs/wechat';
|
||||||
import {
|
import { toLogin } from '../libs/login';
|
||||||
toLogin
|
|
||||||
} from '../libs/login';
|
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
import editUserModal from '@/components/eidtUserModal/index.vue'
|
import editUserModal from '@/components/eidtUserModal/index.vue'
|
||||||
// #endif
|
// #endif
|
||||||
@ -209,10 +198,7 @@
|
|||||||
if (res.data.status == 200) {
|
if (res.data.status == 200) {
|
||||||
let time = res.data.result.expires_time - Cache.time();
|
let time = res.data.result.expires_time - Cache.time();
|
||||||
self.$store.commit('UPDATE_USERINFO', res.data.result.user);
|
self.$store.commit('UPDATE_USERINFO', res.data.result.user);
|
||||||
self.$store.commit('LOGIN', {
|
self.$store.commit('LOGIN', { token: res.data.result.token, time: time });
|
||||||
token: res.data.result.token,
|
|
||||||
time: time
|
|
||||||
});
|
|
||||||
self.$store.commit('SETUID', res.data.result.user.uid);
|
self.$store.commit('SETUID', res.data.result.user.uid);
|
||||||
Cache.set(EXPIRES_TIME, res.data.result.expires_time, time);
|
Cache.set(EXPIRES_TIME, res.data.result.expires_time, time);
|
||||||
Cache.set(USER_INFO, res.data.result.user, time);
|
Cache.set(USER_INFO, res.data.result.user, time);
|
||||||
@ -244,13 +230,13 @@
|
|||||||
let pages = getCurrentPages(),
|
let pages = getCurrentPages(),
|
||||||
currPage = pages[pages.length - 1];
|
currPage = pages[pages.length - 1];
|
||||||
this.$emit('authColse', false);
|
this.$emit('authColse', false);
|
||||||
if (this.isGoIndex) {
|
// if (this.isGoIndex) {
|
||||||
uni.switchTab({
|
// uni.switchTab({
|
||||||
url: '/pages/index/index'
|
// url: '/pages/index/index'
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
this.$emit('authColse', false);
|
// this.$emit('authColse', false);
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,95 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="popup" v-if="isShow">
|
|
||||||
<div class="box">
|
|
||||||
<div class="loading"></div>
|
|
||||||
<p>{{str}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Loading',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isShow: false,
|
|
||||||
str: '初始化中',
|
|
||||||
timer: null
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
uni.$on('showLoading', (type, str) => {
|
|
||||||
if (type == true) {
|
|
||||||
this.isShow = true;
|
|
||||||
this.str = str;
|
|
||||||
} else {
|
|
||||||
this.isShow = false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
clickTow(){
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.popup-enter-active,
|
|
||||||
.popup-leave-active {
|
|
||||||
transition: opacity 0.3s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-enter,
|
|
||||||
.popup-leave-to {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 99999999;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: rgba(0, 0, 0, 0.2);
|
|
||||||
.box{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: rgba(0, 0, 0, 0.5);
|
|
||||||
color: #eee;
|
|
||||||
height: 300rpx;
|
|
||||||
width: 300rpx;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading {
|
|
||||||
width: 80rpx;
|
|
||||||
height: 80rpx;
|
|
||||||
border: 6rpx solid #eee;
|
|
||||||
border-top-color: transparent;
|
|
||||||
border-radius: 100%;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
|
|
||||||
animation: circle infinite 0.75s linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes circle {
|
|
||||||
0% {
|
|
||||||
transform: rotate(0);
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,208 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :class="'wf-page wf-page'+type">
|
|
||||||
<!-- left -->
|
|
||||||
|
|
||||||
|
|
||||||
<view>
|
|
||||||
|
|
||||||
<view id="left" v-if="leftList.length">
|
|
||||||
<view v-for="(item,index) in leftList" :key="index"
|
|
||||||
class="wf-itema" @tap="itemTap(item)">
|
|
||||||
<WaterfallsFlowItem :item="item" :isStore="isStore" :type="type" @goShop="goShop"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- right -->
|
|
||||||
<view>
|
|
||||||
<view id="right" v-if="rightList.length">
|
|
||||||
<view v-for="(item,index) in rightList" :key="index"
|
|
||||||
class="wf-itemb" @tap="itemTap(item)">
|
|
||||||
<WaterfallsFlowItem :item="item" :isStore="isStore" :type="type" @goShop="goShop"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import WaterfallsFlowItem from '../WaterfallsFlowItem/WaterfallsFlowItemo.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
WaterfallsFlowItem
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
// 瀑布流列表
|
|
||||||
wfList: {
|
|
||||||
type: Array,
|
|
||||||
require: true
|
|
||||||
},
|
|
||||||
updateNum: {
|
|
||||||
type: Number,
|
|
||||||
default: 10
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
isStore: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '1'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
allList: [], // 全部列表
|
|
||||||
leftList: [], // 左边列表
|
|
||||||
rightList: [], // 右边列表
|
|
||||||
mark: 0, // 列表标记
|
|
||||||
boxHeight: [], // 下标0和1分别为左列和右列高度
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// 监听列表数据变化
|
|
||||||
wfList: {
|
|
||||||
|
|
||||||
handler(nVal,oVal){
|
|
||||||
|
|
||||||
// 如果数据为空或新的列表数据少于旧的列表数据(通常为下拉刷新或切换排序或使用筛选器),初始化变量
|
|
||||||
if (!this.wfList.length ||
|
|
||||||
(this.wfList.length === this.updateNum && this.wfList.length <= this.allList.length)) {
|
|
||||||
this.allList = [];
|
|
||||||
this.leftList = [];
|
|
||||||
this.rightList = [];
|
|
||||||
this.boxHeight = [];
|
|
||||||
this.mark = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果列表有值,调用waterfall方法
|
|
||||||
if (this.wfList.length) {
|
|
||||||
this.allList = this.wfList;
|
|
||||||
this.leftList = [];
|
|
||||||
this.rightList = [];
|
|
||||||
this.boxHeight = [];
|
|
||||||
this.allList.forEach((v, i) => {
|
|
||||||
if(this.allList.length < 3 || (this.allList.length <= 7 && this.allList.length - i > 1) || (this.allList.length > 7 && this.allList.length - i > 2)) {
|
|
||||||
if(i % 2){
|
|
||||||
this.rightList.push(v);
|
|
||||||
}else{
|
|
||||||
this.leftList.push(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(this.allList.length < 3){
|
|
||||||
this.mark = this.allList.length+1;
|
|
||||||
}else if(this.allList.length <= 7){
|
|
||||||
this.mark = this.allList.length - 1;
|
|
||||||
}else{
|
|
||||||
this.mark = this.allList.length - 2;
|
|
||||||
}
|
|
||||||
if(this.mark < this.allList.length){
|
|
||||||
this.waterFall()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
deep:true
|
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
// 监听标记,当标记发生变化,则执行下一个item排序
|
|
||||||
mark() {
|
|
||||||
const len = this.allList.length;
|
|
||||||
if (this.mark < len && this.mark !== 0 && this.boxHeight.length) {
|
|
||||||
this.waterFall();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 瀑布流排序
|
|
||||||
waterFall() {
|
|
||||||
const i = this.mark;
|
|
||||||
|
|
||||||
if (i == 0) {
|
|
||||||
// 初始化,从左边开始插入
|
|
||||||
this.leftList.push(this.allList[i]);
|
|
||||||
// 更新左边列表高度
|
|
||||||
this.getViewHeight(0);
|
|
||||||
} else if (i == 1) {
|
|
||||||
// 第二个item插入,默认为右边插入
|
|
||||||
this.rightList.push(this.allList[i]);
|
|
||||||
// 更新右边列表高度
|
|
||||||
this.getViewHeight(1);
|
|
||||||
} else {
|
|
||||||
// 根据左右列表高度判断下一个item应该插入哪边
|
|
||||||
if(!this.boxHeight.length){
|
|
||||||
this.rightList.length < this.leftList.length
|
|
||||||
? this.rightList.push(this.allList[i])
|
|
||||||
: this.leftList.push(this.allList[i]);
|
|
||||||
} else {
|
|
||||||
const leftOrRight = this.boxHeight[0] > this.boxHeight[1] ? 1 : 0;
|
|
||||||
if (leftOrRight) {
|
|
||||||
this.rightList.push(this.allList[i])
|
|
||||||
} else {
|
|
||||||
this.leftList.push(this.allList[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 更新插入列表高度
|
|
||||||
this.getViewHeight();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 获取列表高度
|
|
||||||
getViewHeight() {
|
|
||||||
// 使用nextTick,确保页面更新结束后,再请求高度
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(()=>{
|
|
||||||
uni.createSelectorQuery().in(this).select('#right').boundingClientRect(res => {
|
|
||||||
res ? this.boxHeight[1] = res.height : '';
|
|
||||||
uni.createSelectorQuery().in(this).select('#left').boundingClientRect(res => {
|
|
||||||
res ? this.boxHeight[0] = res.height : '';
|
|
||||||
this.mark = this.mark + 1;
|
|
||||||
}).exec();
|
|
||||||
}).exec();
|
|
||||||
},100)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// item点击
|
|
||||||
itemTap(item) {
|
|
||||||
// this.$emit('itemTap', item)
|
|
||||||
},
|
|
||||||
// item点击
|
|
||||||
goShop(item) {
|
|
||||||
this.$emit('goShop', item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$page-padding: 10px;
|
|
||||||
$grid-gap: 5px;
|
|
||||||
|
|
||||||
.wf-page {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-gap: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-itema {
|
|
||||||
width: 356rpx;
|
|
||||||
padding-bottom: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-itemb {
|
|
||||||
width: 356rpx;
|
|
||||||
padding-bottom: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-page1 .wf-item{
|
|
||||||
margin-top: 20rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
.wf-item-page{
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,195 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :class="'wf-page wf-page'+type">
|
|
||||||
<!-- left -->
|
|
||||||
<view>
|
|
||||||
<view id="left" v-if="leftList.length">
|
|
||||||
<view v-for="(item,index) in leftList" :key="index"
|
|
||||||
class="wf-item" @tap="itemTap(item)">
|
|
||||||
<WaterfallsFlowItemp :item="item" :isStore="isStore" :type="type" @goShop="goShop"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- right -->
|
|
||||||
<view>
|
|
||||||
<view id="right" v-if="rightList.length">
|
|
||||||
<view v-for="(item,index) in rightList" :key="index"
|
|
||||||
class="wf-item" @tap="itemTap(item)">
|
|
||||||
<WaterfallsFlowItemp :item="item" :isStore="isStore" :type="type" @goShop="goShop"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import WaterfallsFlowItemp from '../WaterfallsFlowItem/WaterfallsFlowItemp.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
WaterfallsFlowItemp
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
// 瀑布流列表
|
|
||||||
wfList: {
|
|
||||||
type: Array,
|
|
||||||
require: true
|
|
||||||
},
|
|
||||||
updateNum: {
|
|
||||||
type: Number,
|
|
||||||
default: 10
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
isStore: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '1'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
allList: [], // 全部列表
|
|
||||||
leftList: [], // 左边列表
|
|
||||||
rightList: [], // 右边列表
|
|
||||||
mark: 0, // 列表标记
|
|
||||||
boxHeight: [], // 下标0和1分别为左列和右列高度
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// 监听列表数据变化
|
|
||||||
wfList: {
|
|
||||||
handler(nVal,oVal){
|
|
||||||
// 如果数据为空或新的列表数据少于旧的列表数据(通常为下拉刷新或切换排序或使用筛选器),初始化变量
|
|
||||||
if (!this.wfList.length ||
|
|
||||||
(this.wfList.length === this.updateNum && this.wfList.length <= this.allList.length)) {
|
|
||||||
this.allList = [];
|
|
||||||
this.leftList = [];
|
|
||||||
this.rightList = [];
|
|
||||||
this.boxHeight = [];
|
|
||||||
this.mark = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果列表有值,调用waterfall方法
|
|
||||||
if (this.wfList.length) {
|
|
||||||
this.allList = this.wfList;
|
|
||||||
this.leftList = [];
|
|
||||||
this.rightList = [];
|
|
||||||
this.boxHeight = [];
|
|
||||||
this.allList.forEach((v, i) => {
|
|
||||||
if(this.allList.length < 3 || (this.allList.length <= 7 && this.allList.length - i > 1) || (this.allList.length > 7 && this.allList.length - i > 2)) {
|
|
||||||
if(i % 2){
|
|
||||||
this.rightList.push(v);
|
|
||||||
}else{
|
|
||||||
this.leftList.push(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(this.allList.length < 3){
|
|
||||||
this.mark = this.allList.length+1;
|
|
||||||
}else if(this.allList.length <= 7){
|
|
||||||
this.mark = this.allList.length - 1;
|
|
||||||
}else{
|
|
||||||
this.mark = this.allList.length - 2;
|
|
||||||
}
|
|
||||||
if(this.mark < this.allList.length){
|
|
||||||
this.waterFall()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
deep:true
|
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
},
|
|
||||||
|
|
||||||
// 监听标记,当标记发生变化,则执行下一个item排序
|
|
||||||
mark() {
|
|
||||||
const len = this.allList.length;
|
|
||||||
if (this.mark < len && this.mark !== 0 && this.boxHeight.length) {
|
|
||||||
this.waterFall();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 瀑布流排序
|
|
||||||
waterFall() {
|
|
||||||
const i = this.mark;
|
|
||||||
if (i == 0) {
|
|
||||||
// 初始化,从左边开始插入
|
|
||||||
this.leftList.push(this.allList[i]);
|
|
||||||
// 更新左边列表高度
|
|
||||||
this.getViewHeight(0);
|
|
||||||
} else if (i == 1) {
|
|
||||||
// 第二个item插入,默认为右边插入
|
|
||||||
this.rightList.push(this.allList[i]);
|
|
||||||
// 更新右边列表高度
|
|
||||||
this.getViewHeight(1);
|
|
||||||
} else {
|
|
||||||
// 根据左右列表高度判断下一个item应该插入哪边
|
|
||||||
if(!this.boxHeight.length){
|
|
||||||
this.rightList.length < this.leftList.length
|
|
||||||
? this.rightList.push(this.allList[i])
|
|
||||||
: this.leftList.push(this.allList[i]);
|
|
||||||
} else {
|
|
||||||
const leftOrRight = this.boxHeight[0] > this.boxHeight[1] ? 1 : 0;
|
|
||||||
if (leftOrRight) {
|
|
||||||
this.rightList.push(this.allList[i])
|
|
||||||
} else {
|
|
||||||
this.leftList.push(this.allList[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 更新插入列表高度
|
|
||||||
this.getViewHeight();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 获取列表高度
|
|
||||||
getViewHeight() {
|
|
||||||
// 使用nextTick,确保页面更新结束后,再请求高度
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(()=>{
|
|
||||||
uni.createSelectorQuery().in(this).select('#right').boundingClientRect(res => {
|
|
||||||
res ? this.boxHeight[1] = res.height : '';
|
|
||||||
uni.createSelectorQuery().in(this).select('#left').boundingClientRect(res => {
|
|
||||||
res ? this.boxHeight[0] = res.height : '';
|
|
||||||
this.mark = this.mark + 1;
|
|
||||||
}).exec();
|
|
||||||
}).exec();
|
|
||||||
},100)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// item点击
|
|
||||||
itemTap(item) {
|
|
||||||
this.$emit('itemTap', item)
|
|
||||||
},
|
|
||||||
// item点击
|
|
||||||
goShop(item) {
|
|
||||||
this.$emit('goShop', item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$page-padding: 10px;
|
|
||||||
$grid-gap: 10px;
|
|
||||||
|
|
||||||
.wf-page {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-gap: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-item {
|
|
||||||
width: calc((100vw - 2 * #{$page-padding} - #{$grid-gap}) / 2);
|
|
||||||
padding-bottom: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-page1 .wf-item{
|
|
||||||
margin-top: 20rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
.wf-item-page{
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,207 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :class="'wf-page wf-page'+type">
|
|
||||||
<!-- left -->
|
|
||||||
|
|
||||||
<view>
|
|
||||||
|
|
||||||
<view id="left" v-if="leftList.length">
|
|
||||||
<view v-for="(item,index) in leftList" :key="index"
|
|
||||||
class="wf-itema" @tap="itemTap(item)">
|
|
||||||
<WaterfallsFlowItem :item="item" :isStore="isStore" :heightx="251" :type="type" @goShop="goShop"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- right -->
|
|
||||||
<view>
|
|
||||||
<view id="right" v-if="rightList.length">
|
|
||||||
<view v-for="(item,index) in rightList" :key="index"
|
|
||||||
class="wf-itemb" @tap="itemTap(item)">
|
|
||||||
<WaterfallsFlowItem :item="item" :isStore="isStore" :heightx="336" :type="type" @goShop="goShop"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import WaterfallsFlowItem from '../WaterfallsFlowItem/WaterfallsFlowItems.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
WaterfallsFlowItem
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
// 瀑布流列表
|
|
||||||
wfList: {
|
|
||||||
type: Array,
|
|
||||||
require: true
|
|
||||||
},
|
|
||||||
updateNum: {
|
|
||||||
type: Number,
|
|
||||||
default: 10
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
isStore: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '1'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
allList: [], // 全部列表
|
|
||||||
leftList: [], // 左边列表
|
|
||||||
rightList: [], // 右边列表
|
|
||||||
mark: 0, // 列表标记
|
|
||||||
boxHeight: [], // 下标0和1分别为左列和右列高度
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
// 监听列表数据变化
|
|
||||||
wfList: {
|
|
||||||
|
|
||||||
handler(nVal,oVal){
|
|
||||||
|
|
||||||
// 如果数据为空或新的列表数据少于旧的列表数据(通常为下拉刷新或切换排序或使用筛选器),初始化变量
|
|
||||||
if (!this.wfList.length ||
|
|
||||||
(this.wfList.length === this.updateNum && this.wfList.length <= this.allList.length)) {
|
|
||||||
this.allList = [];
|
|
||||||
this.leftList = [];
|
|
||||||
this.rightList = [];
|
|
||||||
this.boxHeight = [];
|
|
||||||
this.mark = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果列表有值,调用waterfall方法
|
|
||||||
if (this.wfList.length) {
|
|
||||||
this.allList = this.wfList;
|
|
||||||
this.leftList = [];
|
|
||||||
this.rightList = [];
|
|
||||||
this.boxHeight = [];
|
|
||||||
this.allList.forEach((v, i) => {
|
|
||||||
if(this.allList.length < 3 || (this.allList.length <= 7 && this.allList.length - i > 1) || (this.allList.length > 7 && this.allList.length - i > 2)) {
|
|
||||||
if(i % 2){
|
|
||||||
this.rightList.push(v);
|
|
||||||
}else{
|
|
||||||
this.leftList.push(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if(this.allList.length < 3){
|
|
||||||
this.mark = this.allList.length+1;
|
|
||||||
}else if(this.allList.length <= 7){
|
|
||||||
this.mark = this.allList.length - 1;
|
|
||||||
}else{
|
|
||||||
this.mark = this.allList.length - 2;
|
|
||||||
}
|
|
||||||
if(this.mark < this.allList.length){
|
|
||||||
this.waterFall()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
deep:true
|
|
||||||
},
|
|
||||||
|
|
||||||
// 监听标记,当标记发生变化,则执行下一个item排序
|
|
||||||
mark() {
|
|
||||||
const len = this.allList.length;
|
|
||||||
if (this.mark < len && this.mark !== 0 && this.boxHeight.length) {
|
|
||||||
this.waterFall();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
|
|
||||||
// 瀑布流排序
|
|
||||||
waterFall() {
|
|
||||||
const i = this.mark;
|
|
||||||
if (i == 0) {
|
|
||||||
// 初始化,从左边开始插入
|
|
||||||
this.leftList.push(this.allList[i]);
|
|
||||||
// 更新左边列表高度
|
|
||||||
this.getViewHeight(0);
|
|
||||||
} else if (i == 1) {
|
|
||||||
// 第二个item插入,默认为右边插入
|
|
||||||
this.rightList.push(this.allList[i]);
|
|
||||||
// 更新右边列表高度
|
|
||||||
this.getViewHeight(1);
|
|
||||||
} else {
|
|
||||||
// 根据左右列表高度判断下一个item应该插入哪边
|
|
||||||
if(!this.boxHeight.length){
|
|
||||||
this.rightList.length < this.leftList.length
|
|
||||||
? this.rightList.push(this.allList[i])
|
|
||||||
: this.leftList.push(this.allList[i]);
|
|
||||||
} else {
|
|
||||||
const leftOrRight = this.boxHeight[0] > this.boxHeight[1] ? 1 : 0;
|
|
||||||
if (leftOrRight) {
|
|
||||||
this.rightList.push(this.allList[i])
|
|
||||||
} else {
|
|
||||||
this.leftList.push(this.allList[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 更新插入列表高度
|
|
||||||
this.getViewHeight();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 获取列表高度
|
|
||||||
getViewHeight() {
|
|
||||||
// 使用nextTick,确保页面更新结束后,再请求高度
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(()=>{
|
|
||||||
uni.createSelectorQuery().in(this).select('#right').boundingClientRect(res => {
|
|
||||||
res ? this.boxHeight[1] = res.height : '';
|
|
||||||
uni.createSelectorQuery().in(this).select('#left').boundingClientRect(res => {
|
|
||||||
res ? this.boxHeight[0] = res.height : '';
|
|
||||||
this.mark = this.mark + 1;
|
|
||||||
}).exec();
|
|
||||||
}).exec();
|
|
||||||
},100)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// item点击
|
|
||||||
itemTap(item) {
|
|
||||||
this.$emit('itemTap', item)
|
|
||||||
},
|
|
||||||
// item点击
|
|
||||||
goShop(item) {
|
|
||||||
this.$emit('goShop', item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
$page-padding: 10px;
|
|
||||||
$grid-gap: 5px;
|
|
||||||
|
|
||||||
.wf-page {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
grid-gap: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-itema {
|
|
||||||
width: 356rpx;
|
|
||||||
padding-bottom: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-itemb {
|
|
||||||
width: 356rpx;
|
|
||||||
padding-bottom: $grid-gap;
|
|
||||||
}
|
|
||||||
.wf-page1 .wf-item{
|
|
||||||
margin-top: 20rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 20rpx;
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
.wf-item-page{
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -49,7 +49,7 @@
|
|||||||
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
|
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
|
||||||
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
|
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="score">{{item.rate}}评分 {{item.reply_count}}条评论<text v-if="item.merchant" style="margin-left: 10rpx;">{{item.merchant.street_name}}</text></view>
|
<view class="score">{{item.rate}}评分 {{item.reply_count}}条评论</view>
|
||||||
<view class="company" v-if="item.merchant" @click.stop="goShop(item.merchant.mer_id)">
|
<view class="company" v-if="item.merchant" @click.stop="goShop(item.merchant.mer_id)">
|
||||||
<text class="line1">{{item.merchant.mer_name}}</text>
|
<text class="line1">{{item.merchant.mer_name}}</text>
|
||||||
<view class="flex" v-if="isStore != '1'">
|
<view class="flex" v-if="isStore != '1'">
|
||||||
@ -80,7 +80,7 @@ export default {
|
|||||||
require: true
|
require: true
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: Number|String,
|
type: Number,
|
||||||
default: 0
|
default: 0
|
||||||
},
|
},
|
||||||
isStore: {
|
isStore: {
|
||||||
|
@ -1,226 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="wf-item-page" @click="gogogo(item)">
|
|
||||||
|
|
||||||
<view class='pictrue'>
|
|
||||||
<!-- <image :src="item.image[0]" mode="widthFix" class="item-img" /> -->
|
|
||||||
<image :src="item.image" mode="aspectFill" class="item-img"></image>
|
|
||||||
<!-- <easy-loadimage mode="widthFix" :image-src="item.image[0]"></easy-loadimage> -->
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="title">{{item.store_name}}</view>
|
|
||||||
<!-- <view class="tag">
|
|
||||||
<view class="tag-one">
|
|
||||||
自营商品
|
|
||||||
</view>
|
|
||||||
<view class="tag-two">
|
|
||||||
|
|
||||||
<text class="tag-twoa">折</text>
|
|
||||||
<text class="tag-twob">满20包邮</text>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<view class="relase">
|
|
||||||
<view class="relase-one">
|
|
||||||
{{item.rate}}
|
|
||||||
</view>
|
|
||||||
<view class="relase-two">
|
|
||||||
{{item.reply_count}}评论
|
|
||||||
</view>
|
|
||||||
<view class="relase-two">
|
|
||||||
{{item.merchant&&item.merchant.distance}}
|
|
||||||
</view>
|
|
||||||
<view class="relase-two">
|
|
||||||
{{item.merchant&&item.merchant.street_name}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="price">
|
|
||||||
<span>¥</span>{{item.price.split('.')[0]}}.<text>{{item.price.split('.')[1]}}</text>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="item-info">
|
|
||||||
<view class="info-title" style="margin-right: 10rpx;">
|
|
||||||
{{item.merchant.mer_name}}
|
|
||||||
</view>
|
|
||||||
<view class="info-img">
|
|
||||||
<image src="@/static/images/you.png" mode="aspectFit"></image>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
item: {
|
|
||||||
type: Object,
|
|
||||||
require: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
gogogo(item) {
|
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/goods_details/index?id=' + item.product_id
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.wf-item-page {
|
|
||||||
background: #fff;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 5px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.pictrue {
|
|
||||||
width: 100% !important;
|
|
||||||
height: 345rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 345rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-info {}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
margin: 14rpx 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
padding-right: 12rpx;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
|
|
||||||
margin-left: 21rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
display: flex;
|
|
||||||
margin-left: 21rpx;
|
|
||||||
|
|
||||||
.tag-one {
|
|
||||||
|
|
||||||
text-align: center;
|
|
||||||
padding: 2rpx 9rpx;
|
|
||||||
border-radius: 11rpx 11rpx 11rpx 11rpx;
|
|
||||||
border: 1px solid #3274F9;
|
|
||||||
font-size: 19rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
margin-right: 15rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-two {
|
|
||||||
|
|
||||||
.tag-twoa {
|
|
||||||
width: 130rpx;
|
|
||||||
text-align: center;
|
|
||||||
padding-left: 15rpx;
|
|
||||||
padding-right: 7rpx;
|
|
||||||
border-radius: 11rpx 0px 0px 0rpx;
|
|
||||||
border: 1px solid #F84221;
|
|
||||||
font-size: 19rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag-twob {
|
|
||||||
width: 130rpx;
|
|
||||||
text-align: center;
|
|
||||||
padding: 2rpx 9rpx;
|
|
||||||
border-radius: 0px 11rpx 11rpx 0px;
|
|
||||||
border: 1px solid #F84221;
|
|
||||||
font-size: 19rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.relase {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-left: 21rpx;
|
|
||||||
margin-top: 12rpx;
|
|
||||||
min-height: 26rpx;
|
|
||||||
line-height: 26rpx;
|
|
||||||
|
|
||||||
.relase-one {
|
|
||||||
// font-style: italic;
|
|
||||||
transform: skewX(-15deg);
|
|
||||||
font-size: 26rpx;
|
|
||||||
font-family: SF Pro Display-Regular Italic, SF Pro Display;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #FF6D20;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relase-two {
|
|
||||||
font-size: 23rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #B3B3B3;
|
|
||||||
margin-left: 13rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.price {
|
|
||||||
margin-left: 21rpx;
|
|
||||||
// margin-bottom: 10rpx;
|
|
||||||
color: #F84221;
|
|
||||||
font-size: 44rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
|
|
||||||
span {
|
|
||||||
color: #F84221;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
color: #F84221;
|
|
||||||
font-size: 37rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-info {
|
|
||||||
margin-left: 21rpx;
|
|
||||||
margin-bottom: 25rpx;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
width: 280rpx;
|
|
||||||
height: 39rpx;
|
|
||||||
line-height: 39rpx;
|
|
||||||
background: #F4F7FE;
|
|
||||||
border-radius: 19rpx 19rpx;
|
|
||||||
opacity: 1;
|
|
||||||
font-size: 23rpx;
|
|
||||||
padding-left: 11rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #737373;
|
|
||||||
|
|
||||||
.info-img {
|
|
||||||
width: 21rpx;
|
|
||||||
height: 21rpx;
|
|
||||||
margin-top: 5rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,347 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="type == 0" class="wf-item-page wf-page0" :style="viewColor">
|
|
||||||
<view class='pictrue'>
|
|
||||||
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
|
|
||||||
<view v-if="item.stock == 0" class="sell_out">已售罄</view>
|
|
||||||
<view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture"></view>
|
|
||||||
</view>
|
|
||||||
<view class="text">
|
|
||||||
<view class='name line2'>{{item.store_name}}</view>
|
|
||||||
<view class="acea-row row-middle">
|
|
||||||
<view class='money'>¥<text class='num'>{{item.price}}</text></view>
|
|
||||||
</view>
|
|
||||||
<view v-if="item.show_svip_info && item.show_svip_info.show_svip_price && item.svip_price" class="acea-row row-middle svip">
|
|
||||||
<text class='vip-money'>¥{{item.svip_price}}</text>
|
|
||||||
<view class="vipImg">
|
|
||||||
<image src="/static/images/svip.png"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item_tags">
|
|
||||||
<!-- <text v-if="item.product_type == 0 && item.merchant.type_name" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
|
|
||||||
<text v-else-if="item.product_type == 0 && item.merchant.is_trader" class="font-bg-red b-color">自营</text> -->
|
|
||||||
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
|
|
||||||
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
|
|
||||||
<!-- <text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-else-if="type == 1" class="wf-page1" :style="viewColor">
|
|
||||||
<view class='pictrue'>
|
|
||||||
<easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
|
|
||||||
<view v-if="item.stock == 0" class="sell_out">已售罄</view>
|
|
||||||
<view v-if="item.border_pic" :style="{ backgroundImage: `url(${item.border_pic})` }" class="border-picture"></view>
|
|
||||||
</view>
|
|
||||||
<view class='text'>
|
|
||||||
<view class='name line2'>{{item.store_name}}</view>
|
|
||||||
<view class='money'>
|
|
||||||
¥<text class='num'>{{item.price}}</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="item.show_svip_info.show_svip && item.show_svip_info.show_svip_price" class="acea-row row-middle svip">
|
|
||||||
<text class='vip-money'>¥{{item.svip_price}}</text>
|
|
||||||
<view class="vipImg">
|
|
||||||
<image src="/static/images/svip.png"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item_tags acea-row">
|
|
||||||
<!-- <text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red b-color">{{item.merchant.type_name}}</text>
|
|
||||||
<text v-else-if="item.merchant.is_trader && item.product_type == 0" class="font-bg-red b-color">自营</text> -->
|
|
||||||
<text v-if="item.product_type != 0" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
|
|
||||||
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
|
|
||||||
<!-- <text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text> -->
|
|
||||||
</view>
|
|
||||||
<view class="score">{{item.rate}}评分 {{item.reply_count}}条评论<text v-if="item.merchant" style="margin-left: 10rpx;">{{item.merchant.street_name}}</text></view>
|
|
||||||
<view class="company" v-if="item.merchant" @click.stop="goShop(item.merchant.mer_id)">
|
|
||||||
<text class="line1">{{item.merchant.village_name}}</text>
|
|
||||||
<!-- <view class="flex" v-if="isStore != '1'">
|
|
||||||
进店
|
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 返佣 -->
|
|
||||||
<block v-if="item.max_extension>0 && (item.product_type == 0 || item.product_type == 2)">
|
|
||||||
<view class="foot-bar">
|
|
||||||
<text class="iconfont icon-fenxiang"></text>
|
|
||||||
最高赚 ¥{{item.max_extension}}
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue'
|
|
||||||
import {mapGetters} from "vuex";
|
|
||||||
export default {
|
|
||||||
components:{easyLoadimage},
|
|
||||||
computed: mapGetters(['viewColor']),
|
|
||||||
props: {
|
|
||||||
item: {
|
|
||||||
type: Object,
|
|
||||||
require: true
|
|
||||||
},
|
|
||||||
type: {
|
|
||||||
type: Number|String,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
isStore: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '1'
|
|
||||||
},
|
|
||||||
isLogin: {
|
|
||||||
type: Boolean,
|
|
||||||
require: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
goShop(id) {
|
|
||||||
this.$emit('goShop', id);
|
|
||||||
},
|
|
||||||
authOpen(){
|
|
||||||
this.$emit('authOpen');
|
|
||||||
},
|
|
||||||
followToggle(item){
|
|
||||||
this.$emit('followToggle', item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.wf-item-page {
|
|
||||||
background: #fff;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
}
|
|
||||||
.wf-page0 .coupon{
|
|
||||||
background:rgba(255,248,247,1);
|
|
||||||
border:1px solid rgba(233,51,35,1);
|
|
||||||
border-radius:4rpx;
|
|
||||||
font-size:20rpx;
|
|
||||||
margin-left: 18rpx;
|
|
||||||
padding: 1rpx 4rpx;
|
|
||||||
}
|
|
||||||
.wf-page0 .pictrue{
|
|
||||||
width: 100%!important;
|
|
||||||
height: 345rpx;
|
|
||||||
position: relative;
|
|
||||||
/deep/image,/deep/.easy-loadimage,uni-image{
|
|
||||||
height: 345rpx;
|
|
||||||
border-radius: 16rpx 16rpx 0 0;
|
|
||||||
}
|
|
||||||
.border-picture {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 16rpx 16rpx 0 0;
|
|
||||||
background: center/cover no-repeat;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.loadfail-img{
|
|
||||||
width: 100%;
|
|
||||||
height: 360rpx;
|
|
||||||
}
|
|
||||||
.svip{
|
|
||||||
margin: 5rpx 0 15rpx;
|
|
||||||
}
|
|
||||||
.vip-money {
|
|
||||||
color: #282828;
|
|
||||||
font-size: 22rpx;
|
|
||||||
margin-left: 6rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.vipImg {
|
|
||||||
width: 65rpx;
|
|
||||||
height: 28rpx;
|
|
||||||
margin-left: 4rpx;
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.wf-page0 .name {
|
|
||||||
color: #282828;
|
|
||||||
margin: 20rpx 0 10rpx 0;
|
|
||||||
font-size: 13px;
|
|
||||||
overflow:hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.wf-page0 .text{
|
|
||||||
padding: 0 20rpx;
|
|
||||||
}
|
|
||||||
.wf-page0 .money {
|
|
||||||
font-size: 20rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: var(--view-priceColor);
|
|
||||||
}
|
|
||||||
.b-color {
|
|
||||||
background-color: var(--view-theme);
|
|
||||||
border: 1px solid var(--view-theme);
|
|
||||||
}
|
|
||||||
.wf-page0 .money .num {
|
|
||||||
font-size: 34rpx;
|
|
||||||
}
|
|
||||||
.wf-page1 .wf-item{
|
|
||||||
.name{
|
|
||||||
font-size: 13px;
|
|
||||||
overflow:hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.wf-page1 .pictrue {
|
|
||||||
position: relative;
|
|
||||||
height: 345rpx;
|
|
||||||
width: 100%!important;
|
|
||||||
/deep/image,/deep/.easy-loadimage,uni-image{
|
|
||||||
height: 345rpx;
|
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
|
||||||
}
|
|
||||||
.border-picture {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 20rpx 20rpx 0 0;
|
|
||||||
background: center/cover no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
.sell_out {
|
|
||||||
display: flex;
|
|
||||||
width: 150rpx;
|
|
||||||
height: 150rpx;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border-radius: 100%;
|
|
||||||
background: rgba(0,0,0,.6);
|
|
||||||
color: #fff;
|
|
||||||
font-size: 30rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
margin: -75rpx 0 0 -75rpx;
|
|
||||||
&::before{
|
|
||||||
content: "";
|
|
||||||
display: block;
|
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
border-radius: 100%;
|
|
||||||
border: 1px dashed #fff;
|
|
||||||
position: absolute;
|
|
||||||
top: 5rpx;
|
|
||||||
left: 5rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.loading-img{
|
|
||||||
height: 345rpx;
|
|
||||||
max-height: 360rpx;
|
|
||||||
}
|
|
||||||
.wf-page1 .text {
|
|
||||||
padding: 20rpx 17rpx 26rpx 17rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #222;
|
|
||||||
}
|
|
||||||
.wf-page1 .text .money {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 26rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 8rpx;
|
|
||||||
color: var(--view-priceColor);
|
|
||||||
}
|
|
||||||
.wf-page1 .text .money .num {
|
|
||||||
font-size: 34rpx;
|
|
||||||
}
|
|
||||||
.item_tags{
|
|
||||||
margin-top: 8rpx;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
.item_tags .tags_item {
|
|
||||||
display: flex;
|
|
||||||
font-size: 20rpx;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 5rpx;
|
|
||||||
padding: 0 4rpx;
|
|
||||||
height: 28rpx;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin-right: 8rpx;
|
|
||||||
}
|
|
||||||
.item_tags .tags_item.ticket{
|
|
||||||
color: var(--view-theme);
|
|
||||||
border: 1px solid var(--view-theme);
|
|
||||||
}
|
|
||||||
.item_tags .tags_item.delivery{
|
|
||||||
color: #FF9000;
|
|
||||||
border: 1px solid #FF9000;
|
|
||||||
}
|
|
||||||
.wf-page1 .text .money .ticket-big {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
max-width: 163rpx;
|
|
||||||
padding: 0 6rpx;
|
|
||||||
height: 28rpx;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
background-image: url(~static/images/yh.png);
|
|
||||||
background-size: 100% 100%;
|
|
||||||
font-size: 20rpx;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
.wf-page1 .text .score {
|
|
||||||
margin-top: 10rpx;
|
|
||||||
color: #737373;
|
|
||||||
font-size: 20rpx;
|
|
||||||
}
|
|
||||||
.wf-page1 .text .company {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: #737373;
|
|
||||||
font-size: 20rpx;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
.line1{
|
|
||||||
// max-width: 200rpx;
|
|
||||||
}
|
|
||||||
.flex {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-left: 10rpx;
|
|
||||||
color: #282828;
|
|
||||||
.iconfont {
|
|
||||||
font-size: 16rpx;
|
|
||||||
margin-top: 4rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.foot-bar {
|
|
||||||
width: 100%;
|
|
||||||
height: 52rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background-image: linear-gradient(-90deg, var(--view-bntColor21) 0%, var(--view-bntColor22) 100%);
|
|
||||||
border-radius: 0px 0px 16rpx 16rpx;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 24rpx;
|
|
||||||
.icon-fenxiang {
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,121 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="wf-item-page">
|
|
||||||
<view class='pictrue'>
|
|
||||||
<!-- <image :src="item.image[0]" mode="widthFix" class="item-img" /> -->
|
|
||||||
<image :src="item.image[0]" mode="aspectFill" class="item-img"></image>
|
|
||||||
<!-- <easy-loadimage mode="widthFix" :image-src="item.image[0]"></easy-loadimage> -->
|
|
||||||
</view>
|
|
||||||
<view class="goods_item_img" v-if="item.video_link.length>0">
|
|
||||||
<image src="@/static/images/sp.png" mode="aspectFit"></image>
|
|
||||||
</view>
|
|
||||||
<view class="title">{{item.title}}</view>
|
|
||||||
<view class="item-info">
|
|
||||||
<image :src="(item.author && item.author.avatar) || '/static/images/f.png'" mode="aspectFit"
|
|
||||||
class="info-avatar" />
|
|
||||||
<view class="info-nickname">{{ item.author.nickname }}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
string
|
|
||||||
} from '../../plugin/clipboard/clipboard'
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
item: {
|
|
||||||
type: Object,
|
|
||||||
require: true
|
|
||||||
},
|
|
||||||
heightx: {
|
|
||||||
type: string,
|
|
||||||
require: true
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.wf-item-page {
|
|
||||||
background: #fff;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 5px;
|
|
||||||
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pictrue {
|
|
||||||
width: 100% !important;
|
|
||||||
height: 345rpx;
|
|
||||||
|
|
||||||
image{
|
|
||||||
width: 100% ;
|
|
||||||
height: 345rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.item-info {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods_item_img {
|
|
||||||
position: absolute;
|
|
||||||
top: 20rpx;
|
|
||||||
right: 18rpx;
|
|
||||||
width: 52rpx;
|
|
||||||
height: 52rpx;
|
|
||||||
z-index: 1 !important;
|
|
||||||
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
margin: 12px 0;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
padding: 0 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-avatar {
|
|
||||||
width: 49rpx;
|
|
||||||
height: 49rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-nickname {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,102 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="a_c_home">
|
|
||||||
<view class="c_card">
|
|
||||||
<view class="c_content">
|
|
||||||
<scroll-view style="height: 100%;" scroll-y>
|
|
||||||
<view v-if="info.content" v-html="info.content.content"></view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<view class="btn_box">
|
|
||||||
<image class="btn_img" @click="open()" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/card_btn1.webp"></image>
|
|
||||||
<image class="btn_img" @click="open()" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/card_btn2.webp"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<image class="head_img" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/card_head.webp" info="活动标题"></image>
|
|
||||||
<image class="close_img" @click="close" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/close.png" info="关闭按钮"></image>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getArticleList } from "@/api/api.js"
|
|
||||||
export default {
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
info: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getArticleList();
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
close(){
|
|
||||||
this.$emit('close');
|
|
||||||
},
|
|
||||||
open(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/newActivity/activityDetail/activityDetail'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getArticleList(){
|
|
||||||
getArticleList(25).then(res=>{
|
|
||||||
this.info = res.data.list[0]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.a_c_home{
|
|
||||||
width: 600rpx;
|
|
||||||
height: 90vh;
|
|
||||||
// border: 1px solid red;
|
|
||||||
position: relative;
|
|
||||||
.head_img{
|
|
||||||
width: 568rpx;
|
|
||||||
height: 207rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%);
|
|
||||||
}
|
|
||||||
.c_card{
|
|
||||||
height: calc(100% - 300rpx);
|
|
||||||
width: 100%;
|
|
||||||
background-color: #fff;
|
|
||||||
position: absolute;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
padding: 30rpx;
|
|
||||||
padding-top: 70rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
.c_content{
|
|
||||||
height: calc(100% - 220rpx);
|
|
||||||
width: 100%;
|
|
||||||
// background-color: #eee;
|
|
||||||
}
|
|
||||||
.btn_box{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
.btn_img{
|
|
||||||
width: 461rpx;
|
|
||||||
height: 100rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.close_img{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 60rpx;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%);
|
|
||||||
width: 60rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,62 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="a_h_home">
|
|
||||||
<view class="a_h_body" v-if="show">
|
|
||||||
<image @click.stop="open()" class="a_h_bg" mode="widthFix" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/tow_price_card.webp"></image>
|
|
||||||
<image v-if="showClose" @click.stop="close()" class="a_h_close" src="../static/images/wt_close.png"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props:{
|
|
||||||
showClose: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
open(){
|
|
||||||
this.$emit('click');
|
|
||||||
},
|
|
||||||
close(){
|
|
||||||
this.show = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.a_h_home{
|
|
||||||
position: fixed;
|
|
||||||
bottom: 25vh;
|
|
||||||
right: 30rpx;
|
|
||||||
z-index: 10;
|
|
||||||
width: 180rpx;
|
|
||||||
// height: 150rpx;
|
|
||||||
.a_h_bg{
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.a_h_body{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
// background-color: #eee;
|
|
||||||
position: relative;
|
|
||||||
.a_h_close{
|
|
||||||
position: absolute;
|
|
||||||
right: 5rpx;
|
|
||||||
top: 5rpx;
|
|
||||||
width: 30rpx;
|
|
||||||
height: 30rpx;
|
|
||||||
background-color: rgba(#000, 0.4);
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :style="viewColor" @touchmove.stop.prevent="()=>{}">
|
<view :style="viewColor">
|
||||||
<view class="add_invoicing" :class="invoice.invoice==true?'on':''">
|
<view class="add_invoicing" :class="invoice.invoice==true?'on':''">
|
||||||
<view class='title'>选择发票<text class='iconfont icon-guanbi' @tap='close'></text></view>
|
<view class='title'>选择发票<text class='iconfont icon-guanbi' @tap='close'></text></view>
|
||||||
<form @submit="formSubmit" report-submit="true">
|
<form @submit="formSubmit" report-submit="true">
|
||||||
@ -302,14 +302,10 @@
|
|||||||
this.popupTitle = false;
|
this.popupTitle = false;
|
||||||
},
|
},
|
||||||
changeHeader(e) {
|
changeHeader(e) {
|
||||||
console.log(e);
|
|
||||||
this.receipt_title_type = e.detail.value;
|
this.receipt_title_type = e.detail.value;
|
||||||
if(e.detail.value == 1){
|
if(e.detail.value == 1){
|
||||||
this.receipt_type = 1;
|
this.receipt_type = 1;
|
||||||
this.typeName = '增值税电子普通发票'
|
this.typeName = '增值税电子普通发票'
|
||||||
}else {
|
|
||||||
this.receipt_type = 2;
|
|
||||||
this.typeName = '增值税专用发票'
|
|
||||||
}
|
}
|
||||||
this.receipt_type
|
this.receipt_type
|
||||||
},
|
},
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<text class='iconfont icon-ditu' :class='active==index?"t-color":""'></text>
|
<text class='iconfont icon-ditu' :class='active==index?"t-color":""'></text>
|
||||||
<view class='address'>
|
<view class='address'>
|
||||||
<view class='name' :class='active==index?"t-color":""'>{{item.real_name}}<text class='phone'>{{item.phone}}</text></view>
|
<view class='name' :class='active==index?"t-color":""'>{{item.real_name}}<text class='phone'>{{item.phone}}</text></view>
|
||||||
<view class='line1'>{{item.province}}{{item.city}}{{item.district}}{{item.street || ''}}{{item.brigade}}{{item.detail}}</view>
|
<view class='line1'>{{item.province}}{{item.city}}{{item.district}}{{item.street || ''}}{{item.detail}}</view>
|
||||||
</view>
|
</view>
|
||||||
<text class='iconfont icon-complete' :class='active==index?"t-color":""'></text>
|
<text class='iconfont icon-complete' :class='active==index?"t-color":""'></text>
|
||||||
</view>
|
</view>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<image src='../../static/images/noAddress.png'></image>
|
<image src='../../static/images/noAddress.png'></image>
|
||||||
<view>暂无地址</view>
|
<view>暂无地址</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='addressBnt' @tap='goAddressPages'>添加/编辑地址</view>
|
<view class='addressBnt' @tap='goAddressPages'>添加新地址</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='mask' catchtouchmove="true" :hidden='address.address==false' @tap='close'></view>
|
<view class='mask' catchtouchmove="true" :hidden='address.address==false' @tap='close'></view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import {getAddressList} from '@/api/user.js';
|
import {getAddressList} from '@/api/user.js';
|
||||||
import { getCityV2,village } from '@/api/api.js';
|
import { getCityV2 } from '@/api/api.js';
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
const CACHE_ADDRESS = {};
|
const CACHE_ADDRESS = {};
|
||||||
export default {
|
export default {
|
||||||
@ -87,74 +87,25 @@
|
|||||||
this.loadAddress(0)
|
this.loadAddress(0)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
change(pid){
|
change(pid,index){
|
||||||
if(this.selectedIndex == index) return;
|
if(this.selectedIndex == index) return;
|
||||||
if(pid === -1){
|
if(pid === -1){
|
||||||
pid = this.selectedArr.length ? this.selectedArr[this.selectedArr.length -1].id : 0;
|
pid = this.selectedArr.length ? this.selectedArr[this.selectedArr.length -1].id : 0;
|
||||||
}
|
}
|
||||||
console.log(index)
|
|
||||||
this.selectedIndex = index;
|
this.selectedIndex = index;
|
||||||
this.loadAddress(pid);
|
this.loadAddress(pid);
|
||||||
},
|
},
|
||||||
loadAddress(pid,type){
|
loadAddress(pid){
|
||||||
if(CACHE_ADDRESS[pid]){
|
if(CACHE_ADDRESS[pid]){
|
||||||
this.addressList = CACHE_ADDRESS[pid];
|
this.addressList = CACHE_ADDRESS[pid];
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
this.is_loading = true;
|
this.is_loading = true;
|
||||||
// getCityV2(pid).then(res=>{
|
getCityV2(pid).then(res=>{
|
||||||
|
|
||||||
// this.is_loading = false;
|
|
||||||
// CACHE_ADDRESS[pid] = res.data;
|
|
||||||
// this.addressList = res.data;
|
|
||||||
// })
|
|
||||||
|
|
||||||
if(type=='province'){
|
|
||||||
|
|
||||||
village({province_code:pid}).then(res=>{
|
|
||||||
this.is_loading = false;
|
|
||||||
CACHE_ADDRESS[pid] = res.data;
|
|
||||||
this.addressList = res.data;
|
|
||||||
|
|
||||||
})
|
|
||||||
}else if(type=='city'){
|
|
||||||
village({city_code:pid}).then(res=>{
|
|
||||||
this.is_loading = false;
|
|
||||||
CACHE_ADDRESS[pid] = res.data;
|
|
||||||
this.addressList = res.data;
|
|
||||||
|
|
||||||
})
|
|
||||||
}else if(type=='area'){
|
|
||||||
village({area_code:pid}).then(res=>{
|
|
||||||
if(res.data.length>0){
|
|
||||||
this.is_loading = false;
|
|
||||||
CACHE_ADDRESS[pid] = res.data;
|
|
||||||
this.addressList = res.data;
|
|
||||||
}else{
|
|
||||||
this.$emit('submit', [...this.selectedArr]);
|
|
||||||
this.$emit('changeClose');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if(type=='street'){
|
|
||||||
village({street_code:pid}).then(res=>{
|
|
||||||
if(res.data.length>0){
|
|
||||||
this.is_loading = false;
|
|
||||||
CACHE_ADDRESS[pid] = res.data;
|
|
||||||
this.addressList = res.data;
|
|
||||||
}else{
|
|
||||||
this.$emit('submit', [...this.selectedArr]);
|
|
||||||
this.$emit('changeClose');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
|
|
||||||
village().then(res=>{
|
|
||||||
this.is_loading = false;
|
this.is_loading = false;
|
||||||
CACHE_ADDRESS[pid] = res.data;
|
CACHE_ADDRESS[pid] = res.data;
|
||||||
this.addressList = res.data;
|
this.addressList = res.data;
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
this.goTop()
|
this.goTop()
|
||||||
},
|
},
|
||||||
selected(item){
|
selected(item){
|
||||||
@ -163,49 +114,17 @@
|
|||||||
this.selectedArr.splice(this.selectedIndex + 1,999)
|
this.selectedArr.splice(this.selectedIndex + 1,999)
|
||||||
this.selectedArr[this.selectedIndex] = item;
|
this.selectedArr[this.selectedIndex] = item;
|
||||||
this.selectedIndex = -1;
|
this.selectedIndex = -1;
|
||||||
}
|
}else if(!item.parent_id){
|
||||||
|
|
||||||
// else if(!item.parent_id){
|
|
||||||
// this.selectedArr = [item];
|
|
||||||
// }else{
|
|
||||||
// this.selectedArr.push(item);
|
|
||||||
// }
|
|
||||||
else if(!item.id){
|
|
||||||
this.selectedArr = [item];
|
this.selectedArr = [item];
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
if(this.selectedArr.length>4){
|
|
||||||
let arry=[]
|
|
||||||
arry.push(item)
|
|
||||||
this.selectedArr=arry
|
|
||||||
}else{
|
|
||||||
this.selectedArr.push(item);
|
this.selectedArr.push(item);
|
||||||
}
|
}
|
||||||
|
if(item.snum){
|
||||||
|
this.loadAddress(item.id);
|
||||||
}
|
|
||||||
|
|
||||||
if(item.type=="province"){
|
|
||||||
|
|
||||||
this.loadAddress(item.code,"province");
|
|
||||||
|
|
||||||
}else if(item.type=="city"){
|
|
||||||
this.loadAddress(item.code,"city");
|
|
||||||
}else if(item.type=="area"){
|
|
||||||
this.loadAddress(item.code,"area");
|
|
||||||
}else if(item.type=="street"){
|
|
||||||
this.loadAddress(item.code,"street");
|
|
||||||
} else {
|
} else {
|
||||||
this.$emit('submit', [...this.selectedArr]);
|
this.$emit('submit', [...this.selectedArr]);
|
||||||
this.$emit('changeClose');
|
this.$emit('changeClose');
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(item.snum){
|
|
||||||
// this.loadAddress(item.id);
|
|
||||||
// } else {
|
|
||||||
// this.$emit('submit', [...this.selectedArr]);
|
|
||||||
// this.$emit('changeClose');
|
|
||||||
// }
|
|
||||||
this.goTop()
|
this.goTop()
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
|
@ -457,8 +457,9 @@
|
|||||||
.foot_bar {
|
.foot_bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
// bottom: 54px;
|
bottom: 122.81rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
background: #ffffff;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
<view class="close" @click="closeShowBox"><text class="iconfont icon-guanbi"></text></view>
|
<view class="close" @click="closeShowBox"><text class="iconfont icon-guanbi"></text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="check-item" v-for="(item,index) in radioList" :key="index"
|
<view class="check-item" v-for="(item,index) in radioList" :key="index" :class="{on:index == radioIndex}">
|
||||||
:class="{on:index == radioIndex}">
|
|
||||||
<view>{{item.title}}</view>
|
<view>{{item.title}}</view>
|
||||||
<view class="radio" @click="bindCheck(item,index)">
|
<view class="radio" @click="bindCheck(item,index)">
|
||||||
<block v-if="index == newData.order.isTake">
|
<block v-if="index == newData.order.isTake">
|
||||||
@ -40,79 +39,77 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import {
|
import { mapGetters } from "vuex";
|
||||||
mapGetters
|
export default{
|
||||||
} from "vuex";
|
name:'checkDelivery',
|
||||||
export default {
|
props:{
|
||||||
name: 'checkDelivery',
|
isShowBox:{
|
||||||
props: {
|
type:Boolean,
|
||||||
isShowBox: {
|
default:false
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
},
|
||||||
activeObj: {
|
activeObj:{
|
||||||
type: Object,
|
type:Object,
|
||||||
default: function() {
|
default:function(){
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deliveryName: {
|
deliveryName:{
|
||||||
type: String,
|
type:String,
|
||||||
default: '快递配送'
|
default:'快递配送'
|
||||||
},
|
},
|
||||||
radioList: {
|
radioList:{
|
||||||
type: Array,
|
type:Array,
|
||||||
default: [{
|
default: [
|
||||||
title: '快递配送',
|
{
|
||||||
check: true
|
title:'快递配送',
|
||||||
|
check:true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '到店核销',
|
title:'到店核销',
|
||||||
check: false
|
check:false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: mapGetters(['viewColor']),
|
computed: mapGetters(['viewColor']),
|
||||||
data() {
|
data(){
|
||||||
return {
|
return {
|
||||||
radioIndex: 0,
|
radioIndex:0,
|
||||||
oldRadioIndex: '', //旧的索引
|
oldRadioIndex:'', //旧的索引
|
||||||
newData: {}
|
newData:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.newData = JSON.parse(JSON.stringify(this.activeObj))
|
this.newData = JSON.parse(JSON.stringify(this.activeObj))
|
||||||
},
|
},
|
||||||
methods: {
|
methods:{
|
||||||
// 关闭配送方式弹窗
|
// 关闭配送方式弹窗
|
||||||
closeShowBox() {
|
closeShowBox(){
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
},
|
},
|
||||||
// 选择配送方式
|
// 选择配送方式
|
||||||
bindCheck(item, index) {
|
bindCheck(item,index){
|
||||||
this.newData.order.isTake = index
|
this.newData.order.isTake = index
|
||||||
},
|
},
|
||||||
confirmBtn() {
|
confirmBtn(){
|
||||||
this.$emit('confirmBtn', this.newData)
|
this.$emit('confirmBtn',this.newData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.mask-box {
|
.mask-box{
|
||||||
.bg {
|
.bg{
|
||||||
z-index: 30;
|
z-index: 30;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: rgba(0, 0, 0, 0.5);
|
background: rgba(0,0,0,0.5);
|
||||||
}
|
}
|
||||||
|
.mask-content{
|
||||||
.mask-content {
|
|
||||||
z-index: 40;
|
z-index: 40;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
@ -122,54 +119,45 @@
|
|||||||
border-radius: 16rpx 16rpx 0 0;
|
border-radius: 16rpx 16rpx 0 0;
|
||||||
transform: translate3d(0, 100%, 0);
|
transform: translate3d(0, 100%, 0);
|
||||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||||
|
.title-bar{
|
||||||
.title-bar {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 30rpx 0;
|
padding: 30rpx 0;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
|
.close{
|
||||||
.close {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 30rpx;
|
right: 30rpx;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
|
.iconfont{
|
||||||
.iconfont {
|
|
||||||
color: #8A8A8A;
|
color: #8A8A8A;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.box{
|
||||||
.box {
|
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
|
.check-item{
|
||||||
.check-item {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
margin-bottom: 50rpx;
|
margin-bottom: 50rpx;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
.iconfont{
|
||||||
.iconfont {
|
|
||||||
font-size: 38rpx;
|
font-size: 38rpx;
|
||||||
color: #CCCCCC;
|
color: #CCCCCC;
|
||||||
|
&.icon-xuanzhong1{
|
||||||
&.icon-xuanzhong1 {
|
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.foot{
|
||||||
.foot {
|
|
||||||
padding: 15rpx 30rpx;
|
padding: 15rpx 30rpx;
|
||||||
border-top: 1px solid #F5F5F5;
|
border-top: 1px solid #F5F5F5;
|
||||||
|
.btn{
|
||||||
.btn {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
@ -182,7 +170,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.animated {
|
.animated {
|
||||||
animation-duration: .3s
|
animation-duration: .3s
|
||||||
}
|
}
|
||||||
|
@ -1,129 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- tab选项卡滑动切换 -->
|
|
||||||
<view class="my-tab" ref="myTabRef">
|
|
||||||
<view class="my-tab-item" v-for="(item, index) in tabs" :ref="`tab${item.name}Ref`"
|
|
||||||
:class="{ active: item.name === activeItem }" :key="index">
|
|
||||||
<view class="my-tab-text" ref="tabName" @click="tabClick(item,index)">
|
|
||||||
<view class="name">{{ item.label }}</view>
|
|
||||||
<view class="xian" v-if='isshow'></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
/*
|
|
||||||
tabs -- 传入标签名 array类型 : tabs: [{name: "tabOne",label: "全部"},{...}]
|
|
||||||
activeItem -- 默认第一个class名 string
|
|
||||||
@tabClick -- 自定义点击事件 回传用到 做逻辑判断
|
|
||||||
标签大小、默认颜色、选中颜色,下边框线等样式,已在css中注释,请根据注释修改即可
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: "cx-navTitle",
|
|
||||||
props: {
|
|
||||||
tabs: { //所有标签名
|
|
||||||
type: Array,
|
|
||||||
default: []
|
|
||||||
},
|
|
||||||
activeItem: { //默认第一个 选中的class类名
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
show: {
|
|
||||||
type: Boolean,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isshow: true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.isshow = this.show
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// tab点击
|
|
||||||
tabClick(item, index) {
|
|
||||||
this.$emit('tabClick', item) //回传数据
|
|
||||||
// 触发滑动方法
|
|
||||||
this.scrollLeftTo(item.name);
|
|
||||||
},
|
|
||||||
// 滑动
|
|
||||||
scrollLeftTo(name) {
|
|
||||||
const ref = `tab${name}Ref`;
|
|
||||||
// 获取myTabRef的DOM元素,即类名为my-tab的标签
|
|
||||||
const nav = this.$refs.myTabRef.$el;
|
|
||||||
// 获取当前点击的某一个tab的的DOM元素,即类名为my-tab-item的标签
|
|
||||||
const title = this.$refs[ref][0].$el;
|
|
||||||
// 计算位移偏差
|
|
||||||
// #ifdef H5
|
|
||||||
const to = title.offsetLeft - (nav.offsetWidth - title.offsetWidth) / 2;
|
|
||||||
nav.scrollLeft = to;
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.my-tab {
|
|
||||||
width: 720rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
// height:80rpx;
|
|
||||||
// background: #ffffff;
|
|
||||||
// line-height:80rpx;
|
|
||||||
// border:1px solid red;
|
|
||||||
display: flex;
|
|
||||||
overflow-x: scroll;
|
|
||||||
padding-right: 0rpx;
|
|
||||||
scroll-behavior: smooth; //平稳的滑动效果
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang-SC-Heavy;
|
|
||||||
|
|
||||||
.my-tab-item {
|
|
||||||
padding: 20rpx 35rpx; //标签上下左右距离 -- 在这里改
|
|
||||||
color: #707070; //标签默认颜色 -- 在这里改
|
|
||||||
// height: 0rpx;
|
|
||||||
text-align: center;
|
|
||||||
flex: 1 0 auto;
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
color: #333333; //标签选中颜色 -- 在这里改
|
|
||||||
font-family: PingFang-SC-Heavy;
|
|
||||||
font-weight: 600;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.my-tab-text {
|
|
||||||
.xian {
|
|
||||||
position: relative;
|
|
||||||
top: 0rpx; //下边框线和标签距离 -- 在这里改
|
|
||||||
z-index: 8;
|
|
||||||
width: 26px;
|
|
||||||
margin: 0 auto;
|
|
||||||
border: 1rpx solid #F84221; //标签底部下边框线 -- 在这里改
|
|
||||||
border-radius: 50rpx;
|
|
||||||
padding: 0rpx 30rpx;
|
|
||||||
opacity: 0.6; //下边框线透明度 -- 在这里改
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
position: relative;
|
|
||||||
z-index: 9;
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #F84221;
|
|
||||||
color: #F84221;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 隐藏滚动条
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
height: 0;
|
|
||||||
width: 0;
|
|
||||||
color: transparent;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,448 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view
|
|
||||||
class="e-stat__select"
|
|
||||||
:style="{ width: width, minWidth: minWidth }">
|
|
||||||
<!-- 主体区域 -->
|
|
||||||
<view class="e-select-main">
|
|
||||||
<view
|
|
||||||
class="e-select"
|
|
||||||
:class="{ 'e-select-disabled': disabled }">
|
|
||||||
<view
|
|
||||||
class="e-select__input-box"
|
|
||||||
@click="toggleSelector">
|
|
||||||
<!-- 微信小程序input组件在部分安卓机型上会出现文字重影,placeholder抖动问题,2019年时微信小程序就有这个问题,一直没修复,估计短时间内也别指望修复了 -->
|
|
||||||
<input
|
|
||||||
class="e-select__input-text"
|
|
||||||
:placeholder="placeholder"
|
|
||||||
v-model="currentData"
|
|
||||||
@input="filter"
|
|
||||||
v-if="search && !disabled" />
|
|
||||||
<view
|
|
||||||
class="e-select__input-text"
|
|
||||||
v-else>
|
|
||||||
{{ currentData || currentData === 0 ? currentData : placeholder }}
|
|
||||||
</view>
|
|
||||||
<!-- 用一个更大的盒子包裹图标,便于点击 -->
|
|
||||||
<view
|
|
||||||
class="e-select-icon"
|
|
||||||
@click.stop="clearVal"
|
|
||||||
v-if="currentData && clear && !disabled">
|
|
||||||
<uni-icons
|
|
||||||
type="clear"
|
|
||||||
color="#e1e1e1"
|
|
||||||
size="18"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view
|
|
||||||
class="e-select-icon"
|
|
||||||
@click.stop="toggleSelector"
|
|
||||||
v-else>
|
|
||||||
<uni-icons
|
|
||||||
size="14"
|
|
||||||
color="#999"
|
|
||||||
type="top"
|
|
||||||
class="arrowAnimation"
|
|
||||||
:class="showSelector ? 'top' : 'bottom'"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 全屏遮罩-->
|
|
||||||
<view
|
|
||||||
class="e-select--mask"
|
|
||||||
v-if="showSelector"
|
|
||||||
@click="toggleSelector" />
|
|
||||||
<!-- 选项列表 这里用v-show是因为微信小程序会报警告 [Component] slot "" is not found,v-if会导致开发工具不能正确识别到slot -->
|
|
||||||
<!-- https://developers.weixin.qq.com/community/minihome/doc/000c8295730700d1cd7c81b9656c00 -->
|
|
||||||
<view
|
|
||||||
class="e-select__selector"
|
|
||||||
v-show="showSelector">
|
|
||||||
<!-- 三角小箭头 -->
|
|
||||||
<view class="e-popper__arrow"></view>
|
|
||||||
<scroll-view
|
|
||||||
scroll-y="true"
|
|
||||||
:scroll-top="scrollTop"
|
|
||||||
class="e-select__selector-scroll"
|
|
||||||
:scroll-into-view="scrollToId"
|
|
||||||
:scroll-with-animation="scrollWithAnimation"
|
|
||||||
v-if="showSelector">
|
|
||||||
<view
|
|
||||||
class="e-select__selector-empty"
|
|
||||||
v-if="currentOptions.length === 0">
|
|
||||||
<text>{{ emptyTips }}</text>
|
|
||||||
</view>
|
|
||||||
<!-- 非空,渲染选项列表 -->
|
|
||||||
<view
|
|
||||||
v-else
|
|
||||||
class="e-select__selector-item"
|
|
||||||
:class="[
|
|
||||||
{ highlight: currentData == item[props.text] },
|
|
||||||
{
|
|
||||||
'e-select__selector-item-disabled': item[props.disabled],
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
v-for="(item, index) in currentOptions"
|
|
||||||
:key="index"
|
|
||||||
@click="change(item, index)">
|
|
||||||
<text>{{ item[props.text] }}</text>
|
|
||||||
<view
|
|
||||||
id="scrollToId"
|
|
||||||
v-if="currentData == item[props.text]"></view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'e-select',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 是否显示下拉选择列表
|
|
||||||
showSelector: false,
|
|
||||||
// 当前选项
|
|
||||||
currentOptions: [],
|
|
||||||
// 当前值
|
|
||||||
currentData: '',
|
|
||||||
// 旧的滚动高度
|
|
||||||
oldScrollTop: 0,
|
|
||||||
// 最新的滚动高度
|
|
||||||
scrollTop: 0,
|
|
||||||
// 滚动至的id
|
|
||||||
scrollToId: '',
|
|
||||||
// 滚动动画
|
|
||||||
scrollWithAnimation: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
// 选项列表
|
|
||||||
options: {
|
|
||||||
type: Array,
|
|
||||||
default() {
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// 配置选项
|
|
||||||
props: {
|
|
||||||
type: Object,
|
|
||||||
default: function () {
|
|
||||||
return {
|
|
||||||
text: 'text',
|
|
||||||
value: 'value',
|
|
||||||
disabled: 'disabled',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
// vue2 v-model传值方式
|
|
||||||
value: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
// vue3 v-model传值方式
|
|
||||||
modelValue: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
// 占位
|
|
||||||
placeholder: {
|
|
||||||
type: String,
|
|
||||||
default: '请选择',
|
|
||||||
},
|
|
||||||
// 宽度
|
|
||||||
width: {
|
|
||||||
type: String,
|
|
||||||
default: '100%',
|
|
||||||
},
|
|
||||||
// 最小宽度
|
|
||||||
minWidth: {
|
|
||||||
type: String,
|
|
||||||
default: '120rpx',
|
|
||||||
},
|
|
||||||
// 空值占位
|
|
||||||
emptyTips: {
|
|
||||||
type: String,
|
|
||||||
default: '暂无选项',
|
|
||||||
},
|
|
||||||
// 是否可清除
|
|
||||||
clear: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
// 是否禁用
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
// 开启搜索
|
|
||||||
search: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
// 搜索开启滚动动画
|
|
||||||
animation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
options: {
|
|
||||||
handler() {
|
|
||||||
this.currentOptions = this.options;
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
deep: true,
|
|
||||||
},
|
|
||||||
modelValue: {
|
|
||||||
handler() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
value: {
|
|
||||||
handler() {
|
|
||||||
this.initData();
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 处理数据,此函数用于兼容vue2 vue3 */
|
|
||||||
initData() {
|
|
||||||
this.currentData = '';
|
|
||||||
// vue2
|
|
||||||
if (this.value || this.value === 0) {
|
|
||||||
for (let item of this.options) {
|
|
||||||
if (item[this.props.value] === this.value) {
|
|
||||||
this.currentData = item[this.props.text];
|
|
||||||
this.$emit('getText', this.currentData);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// vue3
|
|
||||||
if (this.modelValue || this.modelValue === 0) {
|
|
||||||
for (let item of this.options) {
|
|
||||||
if (item[this.props.value] === this.modelValue) {
|
|
||||||
this.currentData = item[this.props.text];
|
|
||||||
this.$emit('getText', this.currentData);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 过滤选项列表,会自动回到顶部 */
|
|
||||||
filter() {
|
|
||||||
this.$emit('getText', this.currentData);
|
|
||||||
if (this.currentData) {
|
|
||||||
this.currentOptions = this.options.filter((item) => {
|
|
||||||
return item[this.props.text].indexOf(this.currentData) > -1;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.currentOptions = this.options;
|
|
||||||
}
|
|
||||||
// scrollTop变化,才能触发滚动顶部
|
|
||||||
this.scrollTop = 1;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scrollTop = 0;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 改变值 */
|
|
||||||
change(item, index) {
|
|
||||||
if (item[this.props.disabled]) return;
|
|
||||||
const data = {
|
|
||||||
...item,
|
|
||||||
index,
|
|
||||||
};
|
|
||||||
this.$emit('change', data);
|
|
||||||
this.emit(data);
|
|
||||||
this.toggleSelector();
|
|
||||||
},
|
|
||||||
/** 传递父组件值 */
|
|
||||||
emit(item) {
|
|
||||||
this.$emit('input', item[this.props.value]);
|
|
||||||
this.$emit('update:modelValue', item[this.props.value]);
|
|
||||||
},
|
|
||||||
/** 清空值 */
|
|
||||||
clearVal() {
|
|
||||||
this.$emit('change', 'clear');
|
|
||||||
this.$emit('input', '');
|
|
||||||
this.$emit('update:modelValue', '');
|
|
||||||
},
|
|
||||||
/** 切换下拉显示 */
|
|
||||||
toggleSelector() {
|
|
||||||
if (this.disabled) return;
|
|
||||||
this.showSelector = !this.showSelector;
|
|
||||||
if (this.showSelector) {
|
|
||||||
this.currentOptions = this.options;
|
|
||||||
// scrollToId变化,才能触发scroll-to-view的滚动
|
|
||||||
this.scrollToId = '';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scrollToId = 'scrollToId';
|
|
||||||
// 设计理念:只在filter时触发滚动动画,因为每次打开就触发,用户体验不好
|
|
||||||
if (this.animation) {
|
|
||||||
setTimeout(() => {
|
|
||||||
// 开启滚动动画
|
|
||||||
this.scrollWithAnimation = true;
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// 关闭时关闭动画
|
|
||||||
this.scrollWithAnimation = false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.e-stat__select {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
box-sizing: border-box;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
.e-select-main {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.e-select-disabled {
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
.e-select {
|
|
||||||
font-size: 14px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-radius: 4px;
|
|
||||||
padding: 0 5px;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
user-select: none;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
border: 1px solid #dcdfe6;
|
|
||||||
border-bottom: solid 1px #dddddd;
|
|
||||||
.e-select__input-box {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 34px;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
.e-select-icon {
|
|
||||||
width: 50px;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.arrowAnimation {
|
|
||||||
transition: transform 0.3s;
|
|
||||||
}
|
|
||||||
.top {
|
|
||||||
transform: rotateZ(0deg);
|
|
||||||
}
|
|
||||||
.bottom {
|
|
||||||
transform: rotateZ(180deg);
|
|
||||||
}
|
|
||||||
.e-select__input-text {
|
|
||||||
color: #303030;
|
|
||||||
padding-left: 7px;
|
|
||||||
width: 100%;
|
|
||||||
color: #333;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
-o-text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.e-select__input-placeholder {
|
|
||||||
padding-left: 7px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.e-select--mask {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 999;
|
|
||||||
}
|
|
||||||
.e-select__selector {
|
|
||||||
box-sizing: border-box;
|
|
||||||
position: absolute;
|
|
||||||
top: calc(100% + 12px);
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
background-color: #ffffff;
|
|
||||||
border: 1px solid #ebeef5;
|
|
||||||
border-radius: 6px;
|
|
||||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
||||||
z-index: 999;
|
|
||||||
padding: 4px 4px;
|
|
||||||
transition: all 2s;
|
|
||||||
.e-popper__arrow,
|
|
||||||
.e-popper__arrow::after {
|
|
||||||
position: absolute;
|
|
||||||
display: block;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
left: 50%;
|
|
||||||
border-color: transparent;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 6px;
|
|
||||||
}
|
|
||||||
.e-popper__arrow {
|
|
||||||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03));
|
|
||||||
top: -6px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
margin-right: 3px;
|
|
||||||
border-top-width: 0;
|
|
||||||
border-bottom-color: #ebeef5;
|
|
||||||
}
|
|
||||||
.e-popper__arrow::after {
|
|
||||||
content: ' ';
|
|
||||||
top: 1px;
|
|
||||||
margin-left: -6px;
|
|
||||||
border-top-width: 0;
|
|
||||||
border-bottom-color: #fff;
|
|
||||||
}
|
|
||||||
.e-select__selector-scroll {
|
|
||||||
max-height: 200px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
.e-select__selector-empty,
|
|
||||||
.e-select__selector-item {
|
|
||||||
display: flex;
|
|
||||||
cursor: pointer;
|
|
||||||
line-height: 34px;
|
|
||||||
font-size: 14px;
|
|
||||||
text-align: center;
|
|
||||||
padding: 0px 10px;
|
|
||||||
}
|
|
||||||
.e-select__selector-item:hover {
|
|
||||||
background-color: #f9f9f9;
|
|
||||||
}
|
|
||||||
.e-select__selector-empty:last-child,
|
|
||||||
.e-select__selector-item:last-child {
|
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
.e-select__selector-item-disabled {
|
|
||||||
color: #b1b1b1;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
.highlight {
|
|
||||||
color: #409eff;
|
|
||||||
font-weight: bold;
|
|
||||||
background-color: #f5f7fa;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,169 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="men-ban box " v-if ='isShow' @touchmove.stop.prevent="">
|
|
||||||
<view class="box_next">
|
|
||||||
<view class="box_next_title">
|
|
||||||
<text class="box_next_title_z">{{title}}</text>
|
|
||||||
</view>
|
|
||||||
<slot></slot>
|
|
||||||
<view class="box_next_but_d" v-if="isBut">
|
|
||||||
<view @click='show' class="box_next_but_d_but">
|
|
||||||
<text class="box_next_but_d_but_text">{{nName}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="box_next_but_s" v-else>
|
|
||||||
<view class="box_next_but_s_lbut" @click="lEvent">
|
|
||||||
<text class="box_next_but_d_but_text">{{lName}}</text>
|
|
||||||
</view>
|
|
||||||
<view @click="rEvent" class="box_next_but_s_rbut" hover-class="zcolor-while1">
|
|
||||||
<text class="box_next_but_d_but_text">{{rName}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: "温馨提示"
|
|
||||||
},
|
|
||||||
isShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
nName: String,
|
|
||||||
lName: String,
|
|
||||||
rName: String,
|
|
||||||
isBut: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
show() {
|
|
||||||
|
|
||||||
this.$emit('show');
|
|
||||||
},
|
|
||||||
lEvent() {
|
|
||||||
this.$emit('lEvent');
|
|
||||||
},
|
|
||||||
rEvent() {
|
|
||||||
this.$emit('rEvent');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.men-ban {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
z-index: 999999;
|
|
||||||
background-color: rgba(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next {
|
|
||||||
background-color: #ffffff;
|
|
||||||
width: 550rpx;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_title {
|
|
||||||
padding: 30rpx 30rpx 0 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_title_z {
|
|
||||||
font-size: 31rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_but_d {
|
|
||||||
width: 550rpx;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 130rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_but_d_but {
|
|
||||||
width: 500rpx;
|
|
||||||
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 80rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
background-color: #fee610;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_but_d_but_text {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_but_s {
|
|
||||||
width: 550rpx;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-around;
|
|
||||||
align-items: center;
|
|
||||||
height: 130rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_but_s_lbut {
|
|
||||||
width: 200rpx;
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 80rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_next_but_s_rbut {
|
|
||||||
width: 200rpx;
|
|
||||||
background-color: #fee610;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 80rpx;
|
|
||||||
border-radius: 50rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,213 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<block>
|
|
||||||
<view class='lists'>
|
|
||||||
<view v-for="(item,index) in productList" class="card" :key="index" @click="godDetail(item)">
|
|
||||||
<view class='pictrue on'>
|
|
||||||
<u-image :src='item.image' width="336.45rpx" height="336.45rpx"> </u-image>
|
|
||||||
</view>
|
|
||||||
<view class="goods_content">
|
|
||||||
<view class='name line1'>
|
|
||||||
<text class="text-ellipsis">{{item.store_name}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="item_tags">
|
|
||||||
<text v-if="item.merchant.type_name && item.product_type == 0"
|
|
||||||
class="store_type">{{item.merchant.type_name}}</text>
|
|
||||||
<text v-else-if="item.merchant.is_trader && item.product_type == 0"
|
|
||||||
class="store_type">自营</text>
|
|
||||||
<text v-if="item.product_type != 0"
|
|
||||||
:class="'font_bg-red bt-color type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
|
|
||||||
<text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
|
|
||||||
<text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
|
|
||||||
</view>
|
|
||||||
<view class="score"><text
|
|
||||||
style="font-style: italic;color: #FF6D20;margin-right: 20rpx;font-size: 30rpx;">{{item.rate}}</text>
|
|
||||||
{{item.reply_count}}评论
|
|
||||||
</view>
|
|
||||||
<view class='money'>¥
|
|
||||||
<text
|
|
||||||
class='num'>{{item.price.substring(0, item.price.length - 2)}}</text><text>{{item.price.slice(-2)}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="company" v-if="item.merchant" @click.stop="goShop(item.mer_id)">
|
|
||||||
<text class="line1">{{item.merchant.mer_name}}</text>
|
|
||||||
<view class="flex">
|
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 返佣 -->
|
|
||||||
<!-- <block v-if="item.max_extension>0 && (item.product_type == 0 || item.product_type == 2)">
|
|
||||||
<view class="foot-bar on">
|
|
||||||
最高赚 ¥{{item.max_extension}}
|
|
||||||
</view>
|
|
||||||
</block> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- <view class='noCommodity' v-if="productList.length==0">
|
|
||||||
<view class='pictrue' style=" margin: 60rpx auto;">
|
|
||||||
<image src='/static/images/noCart.png'></image>
|
|
||||||
<view>暂无商品</view>
|
|
||||||
</view>
|
|
||||||
<recommend v-if="recommend_switch == 1" :hostProduct="hostProduct" :isLogin="isLogin"></recommend>
|
|
||||||
</view> -->
|
|
||||||
</block>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
cloudWarehouse
|
|
||||||
} from '@/api/api.js'
|
|
||||||
import {
|
|
||||||
goShopDetail
|
|
||||||
} from '@/libs/order.js'
|
|
||||||
export default {
|
|
||||||
name: "goodsCard",
|
|
||||||
props: {
|
|
||||||
where: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
is_switch: false,
|
|
||||||
productList: "",
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$watch('where', (newValue, oldValue) => {
|
|
||||||
newValue.category_id ? this.get_product_list() : this.productList = []
|
|
||||||
|
|
||||||
}, {
|
|
||||||
deep: true
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
test() {
|
|
||||||
// this.get_product_list()
|
|
||||||
// console.log(this.where)
|
|
||||||
},
|
|
||||||
godDetail(item) {
|
|
||||||
goShopDetail(item, this.uid).then(res => {
|
|
||||||
if (this.isLogin) {
|
|
||||||
initiateAssistApi(item.activity_id).then(res => {
|
|
||||||
let id = res.data.product_assist_set_id;
|
|
||||||
uni.hideLoading();
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/activity/assist_detail/index?id=' + id
|
|
||||||
});
|
|
||||||
}).catch((err) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: err,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.isAuto = true;
|
|
||||||
this.isShowAuth = true
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 去店铺
|
|
||||||
goShop(id) {
|
|
||||||
if (this.hide_mer_status != 1) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/store/home/index?id=${id}`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
get_product_list: function() {
|
|
||||||
let that = this;
|
|
||||||
cloudWarehouse(that.where).then(res => {
|
|
||||||
that.productList = res.data.list
|
|
||||||
}).catch(err => {
|
|
||||||
that.loading = false;
|
|
||||||
that.loadTitle = '加载更多';
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.lists {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #F4F7FE;
|
|
||||||
|
|
||||||
.card {
|
|
||||||
border-radius: 21.03rpx 21.03rpx 21.03rpx 21.03rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
background-color: white;
|
|
||||||
|
|
||||||
// width: 336.45rpx;
|
|
||||||
.store_type {
|
|
||||||
background: linear-gradient(to bottom, #6DD5FA, #3274F9);
|
|
||||||
color: white;
|
|
||||||
border-radius: 10.51rpx 10.51rpx 10.51rpx 10.51rpx;
|
|
||||||
padding: 2rpx 8rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.goods_content {
|
|
||||||
background-color: white;
|
|
||||||
padding: 25rpx 15rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
.textellipsis {
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
// font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item_tags {
|
|
||||||
margin: 5rpx 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.score {
|
|
||||||
color: #B3B3B3;
|
|
||||||
font-size: 22.78rpx;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.money {
|
|
||||||
color: red;
|
|
||||||
margin: 5rpx 0;
|
|
||||||
|
|
||||||
.num {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.company {
|
|
||||||
background-color: #F4F7FE;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 5rpx 14rpx;
|
|
||||||
border-radius: 19.28rpx 19.28rpx 19.28rpx 19.28rpx;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// width: 40vw;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -22,7 +22,6 @@
|
|||||||
<trees :nodes="nodes" :lazy-load="lazyLoad" :loadVideo="loadVideo" />
|
<trees :nodes="nodes" :lazy-load="lazyLoad" :loadVideo="loadVideo" />
|
||||||
<image v-for="(item, index) in imgs" v-bind:key="index" :id="index" :src="item" hidden @load="_load" />
|
<image v-for="(item, index) in imgs" v-bind:key="index" :id="index" :src="item" hidden @load="_load" />
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
<image v-for="(item, index) in imgs" v-bind:key="index" :id="index" :src="item" hidden @load="_load" />
|
|
||||||
</view>
|
</view>
|
||||||
<!--#endif-->
|
<!--#endif-->
|
||||||
</view>
|
</view>
|
||||||
|
@ -27,24 +27,19 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='mask' style="height: 100vh;" catchtouchmove="true" :hidden='popup.show==false' @tap="closePopup">
|
<view class='mask' catchtouchmove="true" :hidden='popup.show==false' @tap="closePopup"></view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { goShopDetail } from '@/libs/order.js'
|
||||||
goShopDetail
|
import { mapGetters } from "vuex";
|
||||||
} from '@/libs/order.js'
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed:{
|
||||||
...mapGetters(['viewColor']),
|
...mapGetters(['viewColor']),
|
||||||
},
|
},
|
||||||
props: {
|
props:{
|
||||||
list: {
|
list: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: []
|
default: []
|
||||||
@ -68,12 +63,11 @@
|
|||||||
// 点击关闭按钮
|
// 点击关闭按钮
|
||||||
closePopup() {
|
closePopup() {
|
||||||
this.$set(this.popup, 'show', false);
|
this.$set(this.popup, 'show', false);
|
||||||
this.$emit("closes")
|
|
||||||
},
|
},
|
||||||
showPopup() {
|
showPopup() {
|
||||||
this.$set(this.popup, 'show', true);
|
this.$set(this.popup, 'show', true);
|
||||||
},
|
},
|
||||||
goDetail(item) {
|
goDetail(item){
|
||||||
if (item.product_type === 1) {
|
if (item.product_type === 1) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/activity/goods_seckill_details/index?id=${item.product_id}&time=${item.stop_time}&spid=${this.uid}`
|
url: `/pages/activity/goods_seckill_details/index?id=${item.product_id}&time=${item.stop_time}&spid=${this.uid}`
|
||||||
@ -86,11 +80,11 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/goods_details/index?id=${item.product_id}&spid=${this.uid}`
|
url: `/pages/goods_details/index?id=${item.product_id}&spid=${this.uid}`
|
||||||
})
|
})
|
||||||
} else if (item.product_type === 4) {
|
}else if (item.product_type === 4) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/activity/combination_details/index?id=${item.activity_id}&spid=${this.uid}`
|
url: `/pages/activity/combination_details/index?id=${item.activity_id}&spid=${this.uid}`
|
||||||
})
|
})
|
||||||
} else if (item.product_type === 40) {
|
}else if (item.product_type === 40) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/activity/combination_status/index?id=${item.activity_id}&spid=${this.uid}`
|
url: `/pages/activity/combination_status/index?id=${item.activity_id}&spid=${this.uid}`
|
||||||
})
|
})
|
||||||
@ -100,7 +94,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.container {
|
.container{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -111,28 +105,23 @@
|
|||||||
transform: translate3d(0, 100%, 0);
|
transform: translate3d(0, 100%, 0);
|
||||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
||||||
max-height: 1000rpx;
|
max-height: 1000rpx;
|
||||||
|
|
||||||
&.on {
|
&.on {
|
||||||
transform: translate3d(0, 0, 0);
|
transform: translate3d(0, 0, 0);
|
||||||
}
|
}
|
||||||
|
.header{
|
||||||
.header {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 40rpx 30rpx;
|
padding: 40rpx 30rpx;
|
||||||
|
.title{
|
||||||
.title {
|
|
||||||
color: #282828;
|
color: #282828;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
}
|
}
|
||||||
|
.iconfont{
|
||||||
.iconfont {
|
|
||||||
color: #8A8A8A;
|
color: #8A8A8A;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-guanbi5 {
|
.icon-guanbi5 {
|
||||||
right: 20rpx;
|
right: 20rpx;
|
||||||
color: #8a8a8a;
|
color: #8a8a8a;
|
||||||
@ -143,49 +132,38 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
scroll-view{
|
||||||
scroll-view {
|
|
||||||
max-height: 800rpx;
|
max-height: 800rpx;
|
||||||
}
|
}
|
||||||
|
.main_count{
|
||||||
.main_count {
|
|
||||||
padding: 0 30rpx 30rpx;
|
padding: 0 30rpx 30rpx;
|
||||||
max-height: 800rpx;
|
max-height: 800rpx;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
|
||||||
/* #ifndef MP */
|
/* #ifndef MP */
|
||||||
&.mb90 {
|
&.mb90{
|
||||||
margin-bottom: 90rpx;
|
margin-bottom: 90rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
.list {
|
.list{
|
||||||
margin-bottom: 40rpx;
|
margin-bottom: 40rpx;
|
||||||
height: auto;
|
height: auto;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
&:last-child{
|
||||||
&:last-child {
|
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.pro_list{
|
||||||
.pro_list {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
.picture,.image,uni-image{
|
||||||
.picture,
|
|
||||||
.image,
|
|
||||||
uni-image {
|
|
||||||
width: 200rpx;
|
width: 200rpx;
|
||||||
height: 200rpx;
|
height: 200rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
.info{
|
||||||
.info {
|
|
||||||
margin-left: 30rpx;
|
margin-left: 30rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
.bottom{
|
||||||
.bottom {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -195,33 +173,29 @@
|
|||||||
bottom: 10rpx;
|
bottom: 10rpx;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
.name{
|
||||||
.name {
|
|
||||||
color: #282828;
|
color: #282828;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
line-height: 45rpx;
|
line-height: 45rpx;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
width: 460rpx;
|
width: 460rpx;
|
||||||
}
|
}
|
||||||
|
.price{
|
||||||
.price {
|
|
||||||
color: var(--view-priceColor);
|
color: var(--view-priceColor);
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
|
text{
|
||||||
text {
|
|
||||||
font-size: 34rpx;
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.buy-btn{
|
||||||
.buy-btn {
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: var(--view-theme);
|
background: var(--view-theme);
|
||||||
border-radius: 28.04rpx 28.04rpx 28.04rpx 28.04rpx;
|
border-radius: 26rpx;
|
||||||
width: 154.21rpx;
|
width: 140rpx;
|
||||||
height: 57.83rpx;
|
height: 48rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -230,5 +204,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,183 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="msg-view">
|
|
||||||
<scroll-view class="msg-view-p" scroll-y="true" :scroll-top="msgPanelScrollTop">
|
|
||||||
<view id="chatArea">
|
|
||||||
<view class="chat-area-line" v-for="(item,index) in msgList">
|
|
||||||
|
|
||||||
<view class="system-msg"
|
|
||||||
:style="{'flex-direction':((item.userName.length + item.content.length)<15?'row':'')}"
|
|
||||||
v-if="item.msg_type == 'system'">
|
|
||||||
<view class="system-msg-detail ">
|
|
||||||
<text class="system-msg-detail-username " v-for="i in item.userName">{{i}}</text>
|
|
||||||
<text class="system-msg-detail-content " v-for="i in ':'">{{i}}</text>
|
|
||||||
<text class="system-msg-detail-content " v-for="i in item.content">{{i}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="user-msg"
|
|
||||||
:style="{'flex-direction':((item.userName.length + item.content.length)<15?'row':'')}" v-else>
|
|
||||||
|
|
||||||
<view class="user-msg-detail">
|
|
||||||
<view class="user-msg-detail-tag">
|
|
||||||
<!-- <text style="text-align: center;font-size: 20px;color: #DD524D;">★1</text> -->
|
|
||||||
<!-- 这里可以根据用户等级显示图片 -->
|
|
||||||
<image :src="item.avatar" class="user-msg-detail-tag"></image>
|
|
||||||
</view>
|
|
||||||
<text class="user-msg-detail-username" v-for="i in item.userName"
|
|
||||||
@click="test(item.userName)">{{i}}</text>
|
|
||||||
<text class="user-msg-detail-content" v-for="i in ':'">{{i}}</text>
|
|
||||||
<text class="user-msg-detail-content" v-for="i in item.content">{{i}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'MhMsgList',
|
|
||||||
props: {
|
|
||||||
msgList: {
|
|
||||||
type: [Object, Array],
|
|
||||||
default: [{
|
|
||||||
userName: "系统通知",
|
|
||||||
content: "直播倡导绿色直播,严禁发布涉黄涉毒涉赌,严禁发布涉政、违法及低俗违规内容。健康直播,文明互动",
|
|
||||||
cmd: "say",
|
|
||||||
|
|
||||||
msg_type: "system"
|
|
||||||
}, ]
|
|
||||||
},
|
|
||||||
msgPanelScrollTop: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
test(e) {
|
|
||||||
uni.showToast({
|
|
||||||
title: e,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
setMsgPanelScroll() {
|
|
||||||
var that = this;
|
|
||||||
setTimeout(function() {
|
|
||||||
const query = uni.createSelectorQuery().in(that);
|
|
||||||
query.select('#chatArea').boundingClientRect(data => {
|
|
||||||
that.msgPanelScrollTop = data.height - 200;
|
|
||||||
}).exec();
|
|
||||||
}, 50)
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.msg-view-p {
|
|
||||||
display: flex;
|
|
||||||
width: 550rpx;
|
|
||||||
height: 550rpx;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.chat-area-line {
|
|
||||||
width: 550upx;
|
|
||||||
|
|
||||||
flex-direction: row;
|
|
||||||
margin-bottom: 5upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.system-msg {
|
|
||||||
width: 550upx;
|
|
||||||
margin-bottom: 5upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.system-msg-detail {
|
|
||||||
// max-width: 550upx;
|
|
||||||
|
|
||||||
padding: 10upx;
|
|
||||||
border-radius: 30upx;
|
|
||||||
background-color: rgba($color: #000000, $alpha: 0.4);
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-right: 14upx;
|
|
||||||
|
|
||||||
>.system-msg-detail-username {
|
|
||||||
color: red;
|
|
||||||
font-size: 32upx;
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 40upx;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
>.system-msg-detail-content {
|
|
||||||
font-size: 32upx;
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 40upx;
|
|
||||||
color: #A0CFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-line {
|
|
||||||
// max-width: 530upx;
|
|
||||||
padding: 10upx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
flex-direction: row;
|
|
||||||
border-radius: 30upx;
|
|
||||||
background-color: rgba($color: #000000, $alpha: 0.4);
|
|
||||||
margin-right: 14upx;
|
|
||||||
font-size: 28upx;
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 40upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-msg {
|
|
||||||
width: 530upx;
|
|
||||||
|
|
||||||
|
|
||||||
margin-bottom: 5upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-msg-detail-tag {
|
|
||||||
width: 40upx;
|
|
||||||
height: 40upx;
|
|
||||||
border-radius: 50%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-msg-detail {
|
|
||||||
padding: 10upx;
|
|
||||||
border-radius: 30upx;
|
|
||||||
background-color: rgba($color: #000000, $alpha: 0.4);
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-right: 14upx;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
>.user-msg-detail-username {
|
|
||||||
color: #A0CFFF;
|
|
||||||
font-size: 32upx;
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 40upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
>.user-msg-detail-content {
|
|
||||||
font-size: 32upx;
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 40upx;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -2,52 +2,33 @@
|
|||||||
<view class="orderGoods" :style="viewColor">
|
<view class="orderGoods" :style="viewColor">
|
||||||
<view class='goodWrapper' :class="'item'+orderData.order_type">
|
<view class='goodWrapper' :class="'item'+orderData.order_type">
|
||||||
<view v-if="orderData.order_type == 1" class="title acea-row row-between-wrapper">
|
<view v-if="orderData.order_type == 1" class="title acea-row row-between-wrapper">
|
||||||
<view class="item-status" :class="'status'+evaluate">{{evaluate == 7 ? '待核销' : '已核销'}}</view>
|
<view class="item-status" :class="'status'+evaluate">{{evaluate == 0 ? '待核销' : '已核销'}}</view>
|
||||||
<view v-if="evaluate != 0 && orderData.verify_time" class="item-date">{{orderData.verify_time}}</view>
|
<view v-if="evaluate != 0 && orderData.verify_time" class="item-date">{{orderData.verify_time}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="(item,index) in cartInfo" :key="index">
|
<view v-for="(item,index) in cartInfo" :key="index">
|
||||||
<view v-if="activityType === 2">
|
<view v-if="activityType === 2">
|
||||||
|
|
||||||
|
|
||||||
<view class='item presell_item'>
|
<view class='item presell_item'>
|
||||||
<view class="acea-row row-between-wrapper">
|
<view class="acea-row row-between-wrapper">
|
||||||
<view class='pictrue' @click="jumpCon(item)">
|
<view class='pictrue' @click="jumpCon(item)">
|
||||||
<image
|
<image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
|
||||||
:src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image'>
|
|
||||||
</image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='acea-row row-between-wrapper'>
|
<view class='acea-row row-between-wrapper'>
|
||||||
<view class='name line1' style="width: 360rpx;"><text
|
<view class='name line1' style="width: 360rpx;"><text class="event_name event_bg">预售</text>{{item.cart_info.product.store_name}}</view>
|
||||||
class="event_name event_bg">预售</text>{{item.cart_info.product.store_name}}
|
<view class='num'><text class="p-color">¥{{item.cart_info.productPresellAttr.presell_price}}</text><br/>x {{item.product_num}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='num'><text
|
<view class='attr line1' v-if="item.cart_info.productAttr.sku" style="margin-top: 0;">{{item.cart_info.productAttr.sku}}</view>
|
||||||
class="p-color">¥{{item.cart_info.productPresellAttr.presell_price}}</text><br />x
|
<view v-if="evaluate === 0 || evaluate === 10 || evaluate === 11" class="event_ship event_color">发货时间:
|
||||||
{{item.product_num}}</view>
|
|
||||||
</view>
|
|
||||||
<view class='attr line1' v-if="item.cart_info.productAttr.sku" style="margin-top: 0;">
|
|
||||||
{{item.cart_info.productAttr.sku}}</view>
|
|
||||||
<view v-if="evaluate === 0 || evaluate === 10 || evaluate === 11"
|
|
||||||
class="event_ship event_color">发货时间:
|
|
||||||
<!--全款预售-->
|
<!--全款预售-->
|
||||||
<text
|
<text v-if="item.cart_info.productPresell.presell_type === 1">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
||||||
v-if="item.cart_info.productPresell.presell_type === 1">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付成功后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
|
||||||
<!--定金预售-->
|
<!--定金预售-->
|
||||||
<text
|
<text v-if="item.cart_info.productPresell.presell_type === 2">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
||||||
v-if="item.cart_info.productPresell.presell_type === 2">{{ item.cart_info.productPresell.delivery_type === 1 ? '支付尾款后' : '预售结束后' }}{{ item.cart_info.productPresell.delivery_day }}天内</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="right-btn-box event_box">
|
<view class="right-btn-box event_box">
|
||||||
|
<view class="btn-item" v-if="item.is_refund ==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0" @click.stop="refund(item)">申请退款</view>
|
||||||
<view class="btn-item"
|
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
|
||||||
v-if="(item.is_refund ==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0)&&evaluate>=0 && evaluate != 1&& evaluate == 2"
|
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
|
||||||
@click.stop="refund(item)">申请退款</view>
|
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.is_refund==0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
|
|
||||||
{{item.product_num - item.refund_num}}</view>
|
|
||||||
<view class='btn-item err' v-if="item.is_refund >1">已退款 x
|
|
||||||
{{item.product_num - item.refund_num}}</view>
|
|
||||||
|
|
||||||
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.is_refund==0'
|
|
||||||
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
|
||||||
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -56,68 +37,44 @@
|
|||||||
<view v-if="orderData.status >= 10" class="event_progress">
|
<view v-if="orderData.status >= 10" class="event_progress">
|
||||||
<view class="progress_list">
|
<view class="progress_list">
|
||||||
<view class="progress_name">阶段一: 买家已付款</view>
|
<view class="progress_name">阶段一: 买家已付款</view>
|
||||||
<view class="progress_price">商品定金 <text
|
<view class="progress_price">商品定金 <text class="align_right">¥{{ orderData.pay_price }}</text></view>
|
||||||
class="align_right">¥{{ orderData.pay_price }}</text></view>
|
<view class="progress_pay">定金实付款<text class="align_right t-color">¥{{ orderData.pay_price }}</text></view>
|
||||||
<view class="progress_pay">定金实付款<text
|
|
||||||
class="align_right t-color">¥{{ orderData.pay_price }}</text></view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="progress_list">
|
<view class="progress_list">
|
||||||
<view class="progress_name">阶段二:
|
<view class="progress_name">阶段二:
|
||||||
<text
|
<text v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 0">未开始</text>
|
||||||
v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 0">未开始</text>
|
<text v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 1">等待买家付尾款</text>
|
||||||
<text
|
<text v-if="orderData.status == 11 || orderData.presellOrder.activeStatus == 2">交易已关闭</text>
|
||||||
v-if="orderData.status == 10 && orderData.presellOrder.activeStatus == 1">等待买家付尾款</text>
|
|
||||||
<text
|
|
||||||
v-if="orderData.status == 11 || orderData.presellOrder.activeStatus == 2">交易已关闭</text>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="progress_price">商品尾款 <text
|
<view class="progress_price">商品尾款 <text class="align_right">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
||||||
class="align_right">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
<view class="progress_pay">尾款需付款<text class="align_right t-color">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
||||||
<view class="progress_pay">尾款需付款<text
|
|
||||||
class="align_right t-color">¥{{ orderData.presellOrder.pay_price }}</text></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else class='item'>
|
<view v-else class='item'>
|
||||||
|
|
||||||
<view class="acea-row row-between-wrapper">
|
<view class="acea-row row-between-wrapper">
|
||||||
<view class='pictrue' @click="jumpCon(item)">
|
<view class='pictrue' @click="jumpCon(item)">
|
||||||
<image
|
<image :src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image' ></image>
|
||||||
:src='(item.cart_info.productAttr && item.cart_info.productAttr.image) || item.cart_info.product.image'>
|
|
||||||
</image>
|
|
||||||
</view>
|
</view>
|
||||||
<view class='text'>
|
<view class='text'>
|
||||||
<view class='acea-row row-between-wrapper'>
|
<view class='acea-row row-between-wrapper'>
|
||||||
<view class='name line1'><text v-if="item.product_type != 0 && item.product_type != 10"
|
<view class='name line1'><text v-if="item.product_type != 0 && item.product_type != 10" :class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>{{item.cart_info.product.store_name}}</view>
|
||||||
:class="'font_bg-red type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>{{item.cart_info.product.store_name}}
|
|
||||||
</view>
|
|
||||||
<view class='num'>x {{item.product_num}}</view>
|
<view class='num'>x {{item.product_num}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class='attr line1' v-if="item.cart_info.productAttr.sku">
|
<view class='attr line1' v-if="item.cart_info.productAttr.sku">{{item.cart_info.productAttr.sku}}</view>
|
||||||
{{item.cart_info.productAttr.sku}}</view>
|
<view class='money p-color' v-if="item.cart_info.product_type ==3">¥{{item.cart_info.productAssistAttr.assist_price}}</view>
|
||||||
<view class='money p-color' v-if="item.cart_info.product_type ==3">
|
<view class='money p-color' v-else-if="item.cart_info.product_type ==4">¥{{item.cart_info.activeSku.active_price}}</view>
|
||||||
¥{{item.cart_info.productAssistAttr.assist_price}}</view>
|
|
||||||
<view class='money p-color' v-else-if="item.cart_info.product_type ==4">
|
|
||||||
¥{{item.cart_info.activeSku.active_price}}</view>
|
|
||||||
<view class='money acea-row row-middle' v-else>
|
<view class='money acea-row row-middle' v-else>
|
||||||
<text>¥{{item.cart_info.productAttr.price}}</text>
|
<text>¥{{item.cart_info.productAttr.price}}</text>
|
||||||
<image v-if="item.cart_info.productAttr.show_svip_price" class="svip-img"
|
<image v-if="item.cart_info.productAttr.show_svip_price" class="svip-img" src="/static/images/svip.png"></image>
|
||||||
src="/static/images/svip.png"></image>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="right-btn-box">
|
<view class="right-btn-box">
|
||||||
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x
|
<view class="btn-item err" v-if="item.is_refund ==1">退款中 x {{item.product_num - item.refund_num}}</view>
|
||||||
{{item.product_num - item.refund_num}}</view>
|
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}</view>
|
||||||
<view class='btn-item err' v-if="item.is_refund >1">已退款 x {{item.product_num - item.refund_num}}
|
<view class="btn-item" v-if="item.is_refund ==0 && evaluate!=9 && orderData.refund_status || item.refund_num > 0" @click.stop="refund(item)">申请退款</view>
|
||||||
</view>
|
<view class='btn-item' v-if='item.is_reply==0 && evaluate==2 && item.refund_num > 0' @click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
||||||
|
|
||||||
<view class="btn-item"
|
|
||||||
v-if="(item.is_refund ==0 && (evaluate != 10 && evaluate != 11) && orderData.refund_status || item.refund_num > 0)&& evaluate!=9 &&evaluate != 1&&evaluate !=4&& evaluate!=3 || evaluate==2"
|
|
||||||
@click.stop="refund(item)">申请退款</view>
|
|
||||||
<view class='btn-item'
|
|
||||||
v-if='item.is_reply==0 && evaluate!=2&& evaluate!=3&& evaluate!=7&& evaluate!=8&& evaluate!=9&& item.refund_num > 0'
|
|
||||||
@click.stop="evaluateTap(item.order_product_id,orderId)">去评价</view>
|
|
||||||
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
<view class='btn-item on' v-else-if="item.is_reply==1 && evaluate==2">已评价</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -136,18 +93,10 @@
|
|||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
// | Author: CRMEB Team <admin@crmeb.com>
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
import {
|
import { openOrderRefundSubscribe } from '@/utils/SubscribeMessage.js';
|
||||||
openOrderRefundSubscribe
|
import { goShopDetail } from '@/libs/order.js'
|
||||||
} from '@/utils/SubscribeMessage.js';
|
import { initiateAssistApi } from '@/api/activity.js';
|
||||||
import {
|
import { mapGetters } from "vuex";
|
||||||
goShopDetail
|
|
||||||
} from '@/libs/order.js'
|
|
||||||
import {
|
|
||||||
initiateAssistApi
|
|
||||||
} from '@/api/activity.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
evaluate: {
|
evaluate: {
|
||||||
@ -182,14 +131,14 @@
|
|||||||
computed: mapGetters(['viewColor']),
|
computed: mapGetters(['viewColor']),
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
totalNmu: '',
|
totalNmu:'',
|
||||||
isTimePay: false, //是否到支付时间
|
isTimePay: false, //是否到支付时间
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch:{
|
||||||
cartInfo: function(nVal, oVal) {
|
cartInfo:function(nVal,oVal){
|
||||||
let num = 0
|
let num = 0
|
||||||
nVal.forEach((item, index) => {
|
nVal.forEach((item,index)=>{
|
||||||
num += item.cart_num
|
num += item.cart_num
|
||||||
})
|
})
|
||||||
this.totalNmu = num
|
this.totalNmu = num
|
||||||
@ -200,28 +149,25 @@
|
|||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
evaluateTap: function(unique, orderId) {
|
evaluateTap:function(unique,orderId){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
|
url:`/pages/users/goods_comment_con/index?uni=${unique}&order_id=${orderId}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 判断是否到支付尾款时间
|
// 判断是否到支付尾款时间
|
||||||
isPayBalance() {
|
isPayBalance(){
|
||||||
let that = this;
|
let that = this;
|
||||||
if (that.orderData.status === 10) {
|
if(that.orderData.status === 10){
|
||||||
if (new Date() < new Date(that.orderData.presellOrder.final_start_time)) {
|
if(new Date() < new Date(that.orderData.presellOrder.final_start_time)){
|
||||||
that.isTimePay = false; //未开始
|
that.isTimePay = false; //未开始
|
||||||
} else if ((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <=
|
}else if((new Date() >= new Date(that.orderData.presellOrder.final_start_time)) && (new Date() <= new Date(that.orderData.presellOrder.final_start_time)) ){
|
||||||
new Date(that.orderData.presellOrder.final_start_time))) {
|
|
||||||
that.isTimePay = true; //立即支付
|
that.isTimePay = true; //立即支付
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
jumpCon: function(item) {
|
jumpCon:function(item){
|
||||||
if (item.product_type == 4) item.activity_id = item.cart_info && item.cart_info.activeSku
|
if(item.product_type == 4)item.activity_id = item.cart_info && item.cart_info.activeSku.product_group_id
|
||||||
.product_group_id
|
if(item.product_type == 3)item.activity_id = item.cart_info && item.cart_info.productAssistAttr.product_assist_id
|
||||||
if (item.product_type == 3) item.activity_id = item.cart_info && item.cart_info.productAssistAttr
|
|
||||||
.product_assist_id
|
|
||||||
goShopDetail(item).then(res => {
|
goShopDetail(item).then(res => {
|
||||||
initiateAssistApi(item.activity_id).then(res => {
|
initiateAssistApi(item.activity_id).then(res => {
|
||||||
let id = res.data.product_assist_set_id;
|
let id = res.data.product_assist_set_id;
|
||||||
@ -238,21 +184,17 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 退款
|
// 退款
|
||||||
refund(item) {
|
refund(item){
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
openOrderRefundSubscribe().then(() => {
|
openOrderRefundSubscribe().then(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual == 1) {
|
if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual == 1){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' +
|
url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
|
||||||
'&ids=' + item.order_product_id + '&refund_type=1&order_type=' + this
|
|
||||||
.orderData.order_type
|
|
||||||
})
|
})
|
||||||
} else {
|
}else{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/refund/select?order_id=' + this.orderId +
|
url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
|
||||||
'&type=1&order_type=' + this.orderData.order_type + '&ids=' + item
|
|
||||||
.order_product_id
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
@ -260,15 +202,13 @@
|
|||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5 || APP-PLUS
|
// #ifdef H5 || APP-PLUS
|
||||||
if (this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual == 1) {
|
if(this.evaluate == 0 || this.evaluate == 9 || this.orderData.is_virtual == 1){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/refund/confirm?order_id=' + this.orderId + '&type=1' + '&ids=' + item
|
url:'/pages/users/refund/confirm?order_id='+this.orderId+'&type=1'+'&ids='+item.order_product_id+'&refund_type=1&order_type='+this.orderData.order_type
|
||||||
.order_product_id + '&refund_type=1&order_type=' + this.orderData.order_type
|
|
||||||
})
|
})
|
||||||
} else {
|
}else{
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/users/refund/select?order_id=' + this.orderId + '&type=1&order_type=' + this
|
url:'/pages/users/refund/select?order_id='+this.orderId+'&type=1&order_type='+this.orderData.order_type+'&ids='+item.order_product_id
|
||||||
.orderData.order_type + '&ids=' + item.order_product_id
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@ -281,27 +221,22 @@
|
|||||||
.orderGoods {
|
.orderGoods {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-color {
|
.p-color {
|
||||||
color: var(--view-priceColor);
|
color: var(--view-priceColor);
|
||||||
}
|
}
|
||||||
|
.t-color{
|
||||||
.t-color {
|
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
}
|
}
|
||||||
|
.svip-img{
|
||||||
.svip-img {
|
|
||||||
width: 65rpx;
|
width: 65rpx;
|
||||||
height: 28rpx;
|
height: 28rpx;
|
||||||
margin: 4rpx 0 0 4rpx;
|
margin: 4rpx 0 0 4rpx;
|
||||||
}
|
}
|
||||||
|
.title{
|
||||||
.title {
|
|
||||||
height: 86rpx;
|
height: 86rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 30rpx;
|
padding: 0 30rpx;
|
||||||
|
&::after{
|
||||||
&::after {
|
|
||||||
content: "";
|
content: "";
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
border-bottom: 2rpx dotted #D8D8D8;
|
border-bottom: 2rpx dotted #D8D8D8;
|
||||||
@ -309,73 +244,60 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
.item-status{
|
||||||
.item-status {
|
|
||||||
color: #999999;
|
color: #999999;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
|
&.status0{
|
||||||
&.status0 {
|
|
||||||
color: #2291F8;
|
color: #2291F8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.item-date{
|
||||||
.item-date {
|
|
||||||
color: #666666;
|
color: #666666;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.right-btn-box{
|
||||||
.right-btn-box {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
&.event_box{
|
||||||
&.event_box {
|
|
||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
|
.btn-item{
|
||||||
.btn-item {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 140rpx;
|
width:140rpx;
|
||||||
height: 46rpx;
|
height:46rpx;
|
||||||
margin-left: 10rpx;
|
margin-left: 10rpx;
|
||||||
border: 1px solid rgba(187, 187, 187, 1);
|
border:1px solid rgba(187,187,187,1);
|
||||||
border-radius: 23rpx;
|
border-radius:23rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
|
&.on{
|
||||||
&.on {
|
background:rgba(220,220,220,1);
|
||||||
background: rgba(220, 220, 220, 1);
|
border-color: rgba(220,220,220,1);
|
||||||
border-color: rgba(220, 220, 220, 1);
|
|
||||||
}
|
}
|
||||||
|
&.err{
|
||||||
&.err {
|
background:rgba(247,247,247,1);
|
||||||
background: rgba(247, 247, 247, 1);
|
border-color: rgba(247,247,247,1);
|
||||||
border-color: rgba(247, 247, 247, 1);
|
|
||||||
color: #AAAAAA;
|
color: #AAAAAA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.event_bg{
|
||||||
.event_bg {
|
|
||||||
background: #FF7F00;
|
background: #FF7F00;
|
||||||
}
|
}
|
||||||
|
.event_color{
|
||||||
.event_color {
|
|
||||||
color: #FF7F00;
|
color: #FF7F00;
|
||||||
}
|
}
|
||||||
|
.presell_item{
|
||||||
.presell_item {
|
|
||||||
height: auto;
|
height: auto;
|
||||||
padding-bottom: 15rpx;
|
padding-bottom: 15rpx;
|
||||||
}
|
}
|
||||||
|
.event_progress{
|
||||||
.event_progress {
|
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|
||||||
.progress_name {
|
.progress_name {
|
||||||
padding-left: 30rpx;
|
padding-left: 30rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
@ -384,8 +306,7 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
position: relative;
|
position: relative;
|
||||||
color: var(--view-theme);
|
color: var(--view-theme);
|
||||||
|
&::before{
|
||||||
&::before {
|
|
||||||
content: "";
|
content: "";
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 5rpx;
|
width: 5rpx;
|
||||||
@ -396,27 +317,23 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.align_right{
|
||||||
.align_right {
|
|
||||||
float: right;
|
float: right;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
.progress_price{
|
||||||
.progress_price {
|
|
||||||
padding: 20rpx 30rpx;
|
padding: 20rpx 30rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
}
|
}
|
||||||
|
.progress_pay{
|
||||||
.progress_pay {
|
|
||||||
padding: 25rpx 30rpx;
|
padding: 25rpx 30rpx;
|
||||||
background: var(--view-minorColor);
|
background: var(--view-minorColor);
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: #282828;
|
color: #282828;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.event_name{
|
||||||
.event_name {
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 9rpx;
|
margin-right: 9rpx;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -426,14 +343,12 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 6rpx;
|
border-radius: 6rpx;
|
||||||
}
|
}
|
||||||
|
.event_ship{
|
||||||
.event_ship {
|
|
||||||
font-size: 20rpx;
|
font-size: 20rpx;
|
||||||
margin-top: 10rpx;
|
margin-top: 10rpx;
|
||||||
}
|
}
|
||||||
|
.goodWrapper.item1{
|
||||||
.goodWrapper.item1 {
|
&::after{
|
||||||
&::after {
|
|
||||||
content: "";
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
<view class="title acea-row row-center-wrapper">
|
<view class="title acea-row row-center-wrapper">
|
||||||
选择付款方式<text class="iconfont icon-guanbi" @click='close'></text>
|
选择付款方式<text class="iconfont icon-guanbi" @click='close'></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="item acea-row row-between-wrapper" @click='goPay(item.number || 0 , item.value)'
|
<view class="item acea-row row-between-wrapper" @click='goPay(item.number || 0 , item.value)' v-for="(item,index) in payMode"
|
||||||
v-for="(item,index) in payMode" :key="index" v-if="item.payStatus == 1">
|
:key="index" v-if="item.payStatus == 1">
|
||||||
<view class="left acea-row row-between-wrapper">
|
<view class="left acea-row row-between-wrapper">
|
||||||
<view class="iconfont" :class="item.icon"></view>
|
<view class="iconfont" :class="item.icon"></view>
|
||||||
<view class="text">
|
<view class="text">
|
||||||
@ -78,7 +78,6 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
goPay: function(number, paytype) {
|
goPay: function(number, paytype) {
|
||||||
|
|
||||||
if (this.isCall) {
|
if (this.isCall) {
|
||||||
return this.$emit('onChangeFun', {
|
return this.$emit('onChangeFun', {
|
||||||
action: 'payCheck',
|
action: 'payCheck',
|
||||||
@ -99,16 +98,13 @@
|
|||||||
// #endif
|
// #endif
|
||||||
} else if (paytype == 'balance') {
|
} else if (paytype == 'balance') {
|
||||||
type = 'balance';
|
type = 'balance';
|
||||||
console.log('123');
|
}else if(paytype == 'alipay'){
|
||||||
} else if (paytype == 'alipay') {
|
|
||||||
// #ifndef MP
|
// #ifndef MP
|
||||||
type = 'alipay';
|
type = 'alipay';
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP
|
// #ifdef MP
|
||||||
type = 'alipayQr';
|
type = 'alipayQr';
|
||||||
// #endif
|
// #endif
|
||||||
} else if (paytype == 'creditBuy') {
|
|
||||||
type = 'creditBuy'
|
|
||||||
}
|
}
|
||||||
if (!that.order_id) return that.$util.Tips({
|
if (!that.order_id) return that.$util.Tips({
|
||||||
title: '请选择要支付的订单'
|
title: '请选择要支付的订单'
|
||||||
@ -123,12 +119,7 @@
|
|||||||
orderApi(that.order_id, {
|
orderApi(that.order_id, {
|
||||||
type: type,
|
type: type,
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
|
return_url: 'http://'+window.location.host+'/pages/users/order_list/index',
|
||||||
return_url: this.order_type == 98 ? 'http://' + window.location.host +
|
|
||||||
'/pages/users/order_list/indexCopy' : 'http://' + window.location.host +
|
|
||||||
'/pages/users/order_list/index',
|
|
||||||
|
|
||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
@ -136,9 +127,7 @@
|
|||||||
orderId = res.data.result.order_id,
|
orderId = res.data.result.order_id,
|
||||||
jsConfig = res.data.result.config,
|
jsConfig = res.data.result.config,
|
||||||
callback_key = res.data.result.pay_key,
|
callback_key = res.data.result.pay_key,
|
||||||
|
goPages = '/pages/users/order_list/index';
|
||||||
goPages = this.order_type == 98 ? '/pages/users/order_list/indexCopy' :
|
|
||||||
'/pages/users/order_list/index'
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'ORDER_EXIST':
|
case 'ORDER_EXIST':
|
||||||
case 'EXTEND_ORDER':
|
case 'EXTEND_ORDER':
|
||||||
@ -162,7 +151,7 @@
|
|||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + '?status=2'
|
url: goPages + '?status=1'
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'alipay':
|
case 'alipay':
|
||||||
@ -172,8 +161,7 @@
|
|||||||
action: 'payClose'
|
action: 'payClose'
|
||||||
});
|
});
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/order_pay_back/index?keyCode=' + callback_key + '&url=' +
|
url: '/pages/order_pay_back/index?keyCode='+callback_key+'&url='+jsConfig,
|
||||||
jsConfig,
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
break;
|
break;
|
||||||
@ -194,34 +182,33 @@
|
|||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + 'status=2'
|
url: goPages + 'status=1'
|
||||||
});
|
});
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
// console.log('测试支付数据无效的catch:'+res.data)
|
// console.log('测试支付数据无效的catch:'+res.data)
|
||||||
if (res.errMsg == 'chooseWXPay:cancel') {
|
if (res.errMsg == 'chooseWXPay:cancel'){
|
||||||
if (that.isCall) {
|
if(that.isCall){
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '取消支付'
|
title: '取消支付'
|
||||||
});
|
});
|
||||||
} else {
|
}else{
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '取消支付'
|
title: '取消支付'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + '?status=1'
|
url: goPages + '?status=0'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
let mp_pay_name = ''
|
let mp_pay_name=''
|
||||||
if (uni.requestOrderPayment) {
|
if(uni.requestOrderPayment){
|
||||||
mp_pay_name = 'requestOrderPayment'
|
mp_pay_name='requestOrderPayment'
|
||||||
} else {
|
}else{
|
||||||
mp_pay_name = 'requestPayment'
|
mp_pay_name='requestPayment'
|
||||||
}
|
}
|
||||||
console.log(mp_pay_name, jsConfig)
|
|
||||||
uni[mp_pay_name]({
|
uni[mp_pay_name]({
|
||||||
provider: 'wxpay',
|
provider: 'wxpay',
|
||||||
orderInfo: jsConfig,
|
orderInfo: jsConfig,
|
||||||
@ -234,21 +221,20 @@
|
|||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + 'status=2'
|
url: goPages + 'status=1'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (e) => {
|
fail: (e) => {
|
||||||
console.log(e)
|
if(that.isCall){
|
||||||
if (that.isCall) {
|
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '取消支付'
|
title: '取消支付'
|
||||||
});
|
});
|
||||||
} else {
|
}else{
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '取消支付'
|
title: '取消支付'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + '?status=1'
|
url: goPages + '?status=0'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -263,11 +249,11 @@
|
|||||||
case "routine":
|
case "routine":
|
||||||
jsConfig.timeStamp = jsConfig.timestamp;
|
jsConfig.timeStamp = jsConfig.timestamp;
|
||||||
that.toPay = true;
|
that.toPay = true;
|
||||||
let mp_pay_name = ''
|
let mp_pay_name=''
|
||||||
if (uni.requestOrderPayment) {
|
if(uni.requestOrderPayment){
|
||||||
mp_pay_name = 'requestOrderPayment'
|
mp_pay_name='requestOrderPayment'
|
||||||
} else {
|
}else{
|
||||||
mp_pay_name = 'requestPayment'
|
mp_pay_name='requestPayment'
|
||||||
}
|
}
|
||||||
uni[mp_pay_name]({
|
uni[mp_pay_name]({
|
||||||
...jsConfig,
|
...jsConfig,
|
||||||
@ -276,14 +262,13 @@
|
|||||||
that.$emit('onChangeFun', {
|
that.$emit('onChangeFun', {
|
||||||
action: 'payClose'
|
action: 'payClose'
|
||||||
});
|
});
|
||||||
if (that.BargainId || that.combinationId || that.pinkId || that
|
if (that.BargainId || that.combinationId || that.pinkId || that.seckillId)
|
||||||
.seckillId)
|
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
title: '支付成功',
|
title: '支付成功',
|
||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + '?status=2'
|
url: goPages + '?status=1'
|
||||||
});
|
});
|
||||||
|
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
@ -291,7 +276,7 @@
|
|||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + '?status=2'
|
url: goPages + '?status=1'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: function(e) {
|
fail: function(e) {
|
||||||
@ -306,8 +291,7 @@
|
|||||||
complete: function(e) {
|
complete: function(e) {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
//关闭当前页面跳转至订单状态
|
//关闭当前页面跳转至订单状态
|
||||||
if (res.errMsg == 'requestPayment:cancel') return that.$util
|
if (res.errMsg == 'requestPayment:cancel') return that.$util.Tips({
|
||||||
.Tips({
|
|
||||||
title: '取消支付'
|
title: '取消支付'
|
||||||
});
|
});
|
||||||
that.$emit('onChangeFun', {
|
that.$emit('onChangeFun', {
|
||||||
@ -329,7 +313,7 @@
|
|||||||
break;
|
break;
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
case 'h5':
|
case 'h5':
|
||||||
let host = window.location.protocol + "//" + window.location.host;
|
let host = window.location.protocol+"//"+window.location.host;
|
||||||
let url = `${host}/pages/order_pay_status/index?order_id=${orderId}`
|
let url = `${host}/pages/order_pay_status/index?order_id=${orderId}`
|
||||||
let eUrl = encodeURIComponent(url)
|
let eUrl = encodeURIComponent(url)
|
||||||
let jsurl = jsConfig.mweb_url || jsConfig.h5_url
|
let jsurl = jsConfig.mweb_url || jsConfig.h5_url
|
||||||
@ -354,7 +338,7 @@
|
|||||||
icon: 'success'
|
icon: 'success'
|
||||||
}, {
|
}, {
|
||||||
tab: 5,
|
tab: 5,
|
||||||
url: goPages + 'status=2'
|
url: goPages + 'status=1'
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -370,10 +354,6 @@
|
|||||||
break;
|
break;
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
return that.$util.Tips({
|
return that.$util.Tips({
|
||||||
@ -395,7 +375,7 @@
|
|||||||
border-radius: 16rpx 16rpx 0 0;
|
border-radius: 16rpx 16rpx 0 0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding-bottom: 60rpx;
|
padding-bottom: 60rpx;
|
||||||
z-index: 99999;
|
z-index: 99;
|
||||||
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
|
||||||
transform: translate3d(0, 100%, 0);
|
transform: translate3d(0, 100%, 0);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<block v-for="(item,index) in imgUrls" :key='index'>
|
<block v-for="(item,index) in imgUrls" :key='index'>
|
||||||
<swiper-item>
|
<swiper-item>
|
||||||
<image :src="item" class="slide-image" mode="aspectFit" />
|
<image :src="item" class="slide-image" />
|
||||||
<!-- <view class="stop" v-if="isType == 2">
|
<!-- <view class="stop" v-if="isType == 2">
|
||||||
<image class="image" src="/static/images/stop.png"></image>
|
<image class="image" src="/static/images/stop.png"></image>
|
||||||
</view> -->
|
</view> -->
|
||||||
@ -56,7 +56,8 @@
|
|||||||
videoContext: ''
|
videoContext: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {},
|
created() {
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -82,7 +83,7 @@
|
|||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
this.isPlay = false
|
this.isPlay = false
|
||||||
this.videoContext = uni.createVideoContext('myVideo', this);
|
this.videoContext = uni.createVideoContext('myVideo', this);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(()=>{
|
||||||
this.videoContext.play();
|
this.videoContext.play();
|
||||||
})
|
})
|
||||||
// #endif
|
// #endif
|
||||||
@ -101,15 +102,13 @@
|
|||||||
height: 710rpx;
|
height: 710rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-bg swiper {
|
.product-bg swiper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.product-bg .slide-image {
|
.product-bg .slide-image {
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
-
|
-
|
||||||
</view>
|
</view>
|
||||||
<view class='item num'>
|
<view class='item num'>
|
||||||
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num" @input="bindCode(attr.productSelect.cart_num)" @keydown="btKeyDown" @keyup="btKeyUp"></input>
|
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num" @input="bindCode(attr.productSelect.cart_num)" @keydown.native="btKeyDown" @keyup.native="btKeyUp"></input>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="iSplus" class="item plus" :class=" attr.productSelect.cart_num >= attr.productSelect.stock || destri ? 'on' : ''"
|
<view v-if="iSplus" class="item plus" :class=" attr.productSelect.cart_num >= attr.productSelect.stock || destri ? 'on' : ''"
|
||||||
@click="CartNumAdd">+</view>
|
@click="CartNumAdd">+</view>
|
||||||
@ -360,36 +360,27 @@
|
|||||||
margin-right: 30rpx;
|
margin-right: 30rpx;
|
||||||
}
|
}
|
||||||
.product-window .cart .carnum .item {
|
.product-window .cart .carnum .item {
|
||||||
|
border: 1px solid #a4a4a4;
|
||||||
width: 63rpx;
|
width: 84rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 42rpx;
|
line-height: 54rpx;
|
||||||
color: #333333;
|
color: #a4a4a4;
|
||||||
font-weight: 400;
|
font-size: 45rpx;
|
||||||
font-size: 26rpx;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.product-window .cart .carnum .reduce {
|
.product-window .cart .carnum .reduce {
|
||||||
border: 1px solid #a4a4a4;
|
border-right: 0;
|
||||||
width: 44rpx;
|
border-radius: 6rpx 0 0 6rpx;
|
||||||
height: 42rpx;
|
line-height: 48rpx;
|
||||||
// border-right: 0;
|
|
||||||
border-radius: 0 7rpx 7rpx 0;
|
|
||||||
line-height: 30rpx;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.product-window .cart .carnum .reduce.on {
|
.product-window .cart .carnum .reduce.on {
|
||||||
border-color: #e3e3e3;
|
border-color: #e3e3e3;
|
||||||
color: #dedede;
|
color: #dedede;
|
||||||
}
|
}
|
||||||
.product-window .cart .carnum .plus {
|
.product-window .cart .carnum .plus {
|
||||||
border: 1px solid #a4a4a4;
|
border-left: 0;
|
||||||
width: 44rpx;
|
border-radius: 0 6rpx 6rpx 0;
|
||||||
height: 42rpx;
|
line-height: 46rpx;
|
||||||
// border-right: 0;
|
|
||||||
border-radius: 0 7rpx 7rpx 0;
|
|
||||||
line-height: 30rpx
|
|
||||||
}
|
}
|
||||||
.product-window .cart .carnum .plus.on {
|
.product-window .cart .carnum .plus.on {
|
||||||
border-color: #e3e3e3;
|
border-color: #e3e3e3;
|
||||||
|
@ -1,627 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="containers" :style="viewColor">
|
|
||||||
<view class="header">
|
|
||||||
|
|
||||||
<view class="search">
|
|
||||||
<text class="iconfont icon-xiazai5"></text>
|
|
||||||
<input type="text" placeholder="请输入商品名称" v-model="searchVal" @input="setValue" confirm-type="search"
|
|
||||||
@confirm="searchBut()" placeholder-class='placeholder'>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="iconclose" @click="close">
|
|
||||||
<image src="@/static/images/wt_close.png" mode="aspectFit"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="main">
|
|
||||||
<scroll-view scroll-y="true" @touchmove.stop>
|
|
||||||
<block>
|
|
||||||
<view v-if="bought.length" @touchmove="onTouchmove" id="goods" class="goods">
|
|
||||||
<view class="picTxt acea-row" v-for="(item, i) in bought" :key="i">
|
|
||||||
<view class="checkbox">
|
|
||||||
<text @click.stop="goodsCheck(item)" v-if="item.check"
|
|
||||||
class="iconfont icon-xuanzhong1"></text>
|
|
||||||
<text @click.stop="goodsCheck(item)" v-else
|
|
||||||
:class="checkedArr.length >=5 ? 'disabled': ''"
|
|
||||||
class="iconfont icon-weixuanzhong"></text>
|
|
||||||
</view>
|
|
||||||
<view class='pictrue'>
|
|
||||||
<image :src='item.image'></image>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class='text'>
|
|
||||||
<view class='line2 name'>{{item.store_name}}</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="picTxt_one" v-if="item.attrValue.length>0">
|
|
||||||
<picker class="slecte" v-if="item.attrValue.length>1"
|
|
||||||
@change="bindPickerChange($event,item.attrValue,i)" :value="index"
|
|
||||||
:range="item.attrValue" :range-key="'sku'">
|
|
||||||
<view class="uni-input">{{item.attrValue[index].sku}}</view>
|
|
||||||
</picker>
|
|
||||||
|
|
||||||
<view class="" style="margin-top: 10rpx;">
|
|
||||||
库存:{{item.attrValue[index].stock}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="picTxt_price">
|
|
||||||
<view class="price">
|
|
||||||
<span>委托价格</span>
|
|
||||||
<input type="text" :value="item.price" placeholder="输入出售价格"
|
|
||||||
@input="producrprice($event,i,item)" adjust-position=""
|
|
||||||
placeholder-style="color: #CCCCCC;" />
|
|
||||||
</view>
|
|
||||||
<view class="price_num">
|
|
||||||
<span>委托数量</span>
|
|
||||||
<subtractive v-if='item.number==0' style="margin-top: 10rpx;margin-left: 20rpx;"
|
|
||||||
class="step" :min="0" :max="item.attrValue[index].stock" :value="peicenumber"
|
|
||||||
:isMax="true" :isMin="true" index="11" @eventChange="numberChange($event,i)">
|
|
||||||
</subtractive>
|
|
||||||
|
|
||||||
<subtractive v-else style="margin-top: 10rpx;margin-left: 20rpx;" class="step"
|
|
||||||
:min="0" :max="item.attrValue[index].stock" :value="item.number" :isMax="true"
|
|
||||||
:isMin="true" index="11" @increment="incrementTotal($event,i,item)"
|
|
||||||
@eventChange="numberChange($event,i)"></subtractive>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-else class="empty">
|
|
||||||
<image src="/static/images/no_thing.png"></image>
|
|
||||||
<text>暂无内容哦~</text>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</scroll-view>
|
|
||||||
<view class="foot_bar">
|
|
||||||
<button class="confirm_btn" @click="submit">确定({{checkedArr.length}})</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Loading from '@/components/Loading/index.vue';
|
|
||||||
import subtractive from '@/components/subtractive/subtractive.vue';
|
|
||||||
|
|
||||||
import {
|
|
||||||
getCommunitygetOrderList
|
|
||||||
} from "@/api/trading-floor";
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
checkedObj: {
|
|
||||||
type: Array,
|
|
||||||
default: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: mapGetters(['viewColor']),
|
|
||||||
components: {
|
|
||||||
Loading,
|
|
||||||
subtractive
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isActive: 0,
|
|
||||||
loadedb: false,
|
|
||||||
loadingb: false,
|
|
||||||
loadedc: false,
|
|
||||||
loadingc: false,
|
|
||||||
loadeds: false,
|
|
||||||
loadings: false,
|
|
||||||
whereb: {
|
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
keyword: '',
|
|
||||||
},
|
|
||||||
peicenumber: 0,
|
|
||||||
|
|
||||||
searchVal: "",
|
|
||||||
checked: [],
|
|
||||||
list: [],
|
|
||||||
|
|
||||||
bought: [],
|
|
||||||
|
|
||||||
checkedArr: [],
|
|
||||||
aryys: [],
|
|
||||||
// picker下拉数据源
|
|
||||||
storageCustomList: [{
|
|
||||||
CustGoodsCode: "TEST001",
|
|
||||||
CustGoodsName: "测试货主001",
|
|
||||||
IfBoxId: 0,
|
|
||||||
IfProductId: 0,
|
|
||||||
}, {
|
|
||||||
CustGoodsCode: "TEST002",
|
|
||||||
CustGoodsName: "测试货主002",
|
|
||||||
IfBoxId: 0,
|
|
||||||
IfProductId: 0,
|
|
||||||
}, {
|
|
||||||
CustGoodsCode: "TEST003",
|
|
||||||
CustGoodsName: "测试货主003",
|
|
||||||
IfBoxId: 0,
|
|
||||||
IfProductId: 0,
|
|
||||||
}],
|
|
||||||
index: 0,
|
|
||||||
pickerData: '请选择',
|
|
||||||
itstock: '',
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
checkedObj: {
|
|
||||||
handler(n) {
|
|
||||||
|
|
||||||
this.checkedArr = n
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.checkedArr = this.checkedObj
|
|
||||||
this.aryys = this.checkedObj
|
|
||||||
this.getBounht();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//价格
|
|
||||||
producrprice(e, i, item) {
|
|
||||||
this.bought[i].price = e.detail.value
|
|
||||||
this.$set(item, 'check', false);
|
|
||||||
for (let i in this.checkedArr) {
|
|
||||||
if (this.checkedArr[i].product_id == item.product_id) {
|
|
||||||
this.checkedArr.splice(i, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
incrementTotal(e, i, item) {
|
|
||||||
this.$set(item, 'check', false);
|
|
||||||
for (let i in this.checkedArr) {
|
|
||||||
if (this.checkedArr[i].product_id == item.product_id) {
|
|
||||||
this.checkedArr.splice(i, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
// picker修改事件
|
|
||||||
bindPickerChange: function(e, storage, num) {
|
|
||||||
this.bought[num].attrValue[this.index].sku = storage[e.detail.value].sku
|
|
||||||
this.bought[num].attrValue[this.index].stock = storage[e.detail.value].stock
|
|
||||||
this.bought[num].product_attr_unique = storage[e.detail.value].unique
|
|
||||||
this.pickerData = storage[this.index] // 这里就是选中的对象
|
|
||||||
|
|
||||||
if (this.bought[num].attrValue[this.index].stock == 0) {
|
|
||||||
this.$util.Tips({
|
|
||||||
title: '库存不足'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 点击关闭按钮
|
|
||||||
close() {
|
|
||||||
this.$emit('close');
|
|
||||||
},
|
|
||||||
numberChange(data, i) {
|
|
||||||
this.peicenumber = data.number;
|
|
||||||
this.bought[i].number = data.number
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
tabs(index) {
|
|
||||||
this.isActive = index
|
|
||||||
this.$set(this.whereb, 'keyword', '');
|
|
||||||
this.searchVal = ''
|
|
||||||
this.searchBut()
|
|
||||||
},
|
|
||||||
onTouchmove(e) {
|
|
||||||
if (this.loadendb) return;
|
|
||||||
if (this.loadingb) return;
|
|
||||||
const query = uni.createSelectorQuery().in(this);
|
|
||||||
query.select('#goods').boundingClientRect(data => {
|
|
||||||
if (data.bottom < 1500 && data.top < 0) {
|
|
||||||
this.getBounht();
|
|
||||||
}
|
|
||||||
}).exec();
|
|
||||||
|
|
||||||
// 模拟触底刷新
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
setValue: function(event) {
|
|
||||||
this.$set(this.whereb, 'keyword', event.detail.value);
|
|
||||||
if (!event.detail.value) {
|
|
||||||
this.whereb.page = 1
|
|
||||||
this.loadedb = false
|
|
||||||
this.getBounht()
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
searchBut() {
|
|
||||||
this.bought = []
|
|
||||||
this.whereb.page = 1
|
|
||||||
this.loadedb = false
|
|
||||||
this.getBounht()
|
|
||||||
},
|
|
||||||
getBounht() {
|
|
||||||
var that = this;
|
|
||||||
// console.log('1111111', that.loadingb, that.loadedb)
|
|
||||||
if (that.loadingb || that.loadedb) return;
|
|
||||||
that.loadingb = true;
|
|
||||||
|
|
||||||
getCommunitygetOrderList(that.whereb).then(
|
|
||||||
res => {
|
|
||||||
that.loadingb = false;
|
|
||||||
that.loadedb = res.data.list.length < that.whereb.limit;
|
|
||||||
that.bought.push.apply(that.bought, res.data.list);
|
|
||||||
that.whereb.page = that.whereb.page + 1;
|
|
||||||
that.getInitchecked(that.bought);
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: error.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/*获取初始化选中的数据*/
|
|
||||||
getInitchecked(arr) {
|
|
||||||
let that = this;
|
|
||||||
arr.forEach((item, index) => {
|
|
||||||
that.$set(item, 'check', false);
|
|
||||||
that.checkedArr.forEach((val, i) => {
|
|
||||||
if (item.product_id == val.product_id) {
|
|
||||||
that.$set(item, 'check', true);
|
|
||||||
that.$set(item, 'number', val.number);
|
|
||||||
that.$set(item, 'price', val.price);
|
|
||||||
that.peicenumber=val.number
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
/*已选中的商品打钩*/
|
|
||||||
getCheckedGoods() {
|
|
||||||
this.checked = []
|
|
||||||
this.checkedArr.forEach((item, index) => {
|
|
||||||
this.checkedArr.push(item)
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/*点击选中与否*/
|
|
||||||
goodsCheck(item) {
|
|
||||||
this.$set(item, 'check', !item.check);
|
|
||||||
if (item.check) {
|
|
||||||
if (this.peicenumber == 0) {
|
|
||||||
item.number = 1
|
|
||||||
}
|
|
||||||
if (!item.product_attr_unique) {
|
|
||||||
item.product_attr_unique = item.attrValue[0].unique
|
|
||||||
}
|
|
||||||
this.checkedArr.push(item)
|
|
||||||
this.arrayUnique(this.checkedArr, 'product_id')
|
|
||||||
} else {
|
|
||||||
this.checkedArr.splice(this.checkedArr.findIndex(itemn => ((itemn.product_id == item.product_id))), 1)
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//去重
|
|
||||||
arrayUnique(arr, name) {
|
|
||||||
let hash = {}
|
|
||||||
const result = arr.reduce((acc, cru, index) => {
|
|
||||||
if (!hash[cru[name]]) {
|
|
||||||
hash[cru[name]] = {
|
|
||||||
index: acc.length
|
|
||||||
}
|
|
||||||
acc.push(cru)
|
|
||||||
} else {
|
|
||||||
console.log(acc, hash[cru[name]])
|
|
||||||
acc.splice(hash[cru[name]]['index'], 1, cru)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
|
|
||||||
}, [])
|
|
||||||
this.checkedArr = result
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
/*确定提交*/
|
|
||||||
submit() {
|
|
||||||
|
|
||||||
this.$emit('getProduct', this.checkedArr);
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.containers {
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 16rpx 16rpx 0 0;
|
|
||||||
padding: 40rpx 0;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
position: relative;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
text {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 50rpx;
|
|
||||||
color: #999999;
|
|
||||||
font-size: 30rpx;
|
|
||||||
|
|
||||||
&.on {
|
|
||||||
color: #333333;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 34rpx;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
display: inline-block;
|
|
||||||
width: 40rpx;
|
|
||||||
height: 5rpx;
|
|
||||||
background: var(--view-theme);
|
|
||||||
position: absolute;
|
|
||||||
bottom: -10rpx;
|
|
||||||
left: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconclose {
|
|
||||||
width: 44rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
line-height: 44rpx;
|
|
||||||
|
|
||||||
border-radius: 50%;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
top: -150rpx;
|
|
||||||
right: 30rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search {
|
|
||||||
margin-top: 44rpx;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
padding: 12rpx 30rpx 12rpx 66rpx;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #939393;
|
|
||||||
position: absolute;
|
|
||||||
top: 20rpx;
|
|
||||||
left: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
color: #999999;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub_title {
|
|
||||||
color: #282828;
|
|
||||||
font-size: 26rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #8A8A8A;
|
|
||||||
font-size: 28rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scroll-view {
|
|
||||||
height: 650rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
height: 650rpx;
|
|
||||||
margin: 40rpx 0 80rpx;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.picTxt {
|
|
||||||
width: 100%;
|
|
||||||
padding: 25rpx 0;
|
|
||||||
position: relative;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
border-top: 2rpx solid #E7E6E4;
|
|
||||||
|
|
||||||
.picTxt_one {
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.picTxt_one {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
|
|
||||||
|
|
||||||
.slecte {
|
|
||||||
margin-right: 30rpx;
|
|
||||||
width: 280rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #959595;
|
|
||||||
background-color: #E7E6E4;
|
|
||||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.picTxt_price {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 37rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
|
|
||||||
.price {
|
|
||||||
display: flex;
|
|
||||||
margin-right: 15rpx;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 210rpx;
|
|
||||||
text-align: center;
|
|
||||||
height: 70rpx;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
margin-left: 20rpx;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.price_num {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.checkbox {
|
|
||||||
margin-right: 30rpx;
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-size: 38rpx;
|
|
||||||
color: #CCCCCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-xuanzhong1 {
|
|
||||||
color: var(--view-theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pictrue {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 160rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 430rpx;
|
|
||||||
margin-left: 30rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #282828;
|
|
||||||
position: relative;
|
|
||||||
height: 160rpx;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
color: #282828;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.money {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
color: var(--view-priceColor);
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.foot_bar {
|
|
||||||
width: 100%;
|
|
||||||
position: fixed;
|
|
||||||
// bottom: 54px;
|
|
||||||
left: 0;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
z-index: 5;
|
|
||||||
|
|
||||||
.confirm_btn {
|
|
||||||
width: 710rpx;
|
|
||||||
height: 86rpx;
|
|
||||||
line-height: 86rpx;
|
|
||||||
color: #ffffff;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 32rpx;
|
|
||||||
background: var(--view-theme);
|
|
||||||
border-radius: 43rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
|
||||||
margin: 130rpx 0 150rpx;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
image,
|
|
||||||
uni-image {
|
|
||||||
display: inline-block;
|
|
||||||
width: 414rpx;
|
|
||||||
height: 305rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
color: #999999;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,190 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="mark" v-if="isShow" @click="close">
|
|
||||||
|
|
||||||
<view class="release">
|
|
||||||
<view class="release_content" v-for="(item,i) in list" :key="i" @click="navigtion(item)">
|
|
||||||
<view class="release_content_left">
|
|
||||||
<view :class="i==1?'release_imga':'release_img'">
|
|
||||||
<image :src="item.img" mode="aspectFit"></image>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="title">
|
|
||||||
<view class="title1">
|
|
||||||
{{item.title1}}
|
|
||||||
</view>
|
|
||||||
<view class="title2">
|
|
||||||
{{item.title2}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="release_content_right ">
|
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="release_close" @click="close">
|
|
||||||
<image src="@/static/images/trad-close.png" mode="aspectFit"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
navigateTo
|
|
||||||
} from '../../libs/uniApi'
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
isShow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// 子组件接收一个布尔类型的bottom,如果为true则弹窗则在页面的底部,false为默认居中显示
|
|
||||||
bottom: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [{
|
|
||||||
img: require('@/static/images/season.png'),
|
|
||||||
title1: '发布调货商品',
|
|
||||||
title2: '镇街店铺快捷调货',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
img: require('@/static/images/discounts.png'),
|
|
||||||
title1: '发布打折商品',
|
|
||||||
title2: '发布店铺打折商品',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
navigtion(item) {
|
|
||||||
|
|
||||||
if (item.title1 =='发布调货商品') {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/trading_hall/transfer_goods/index'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/trading_hall/adddiscounts/index'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.$emit('close')
|
|
||||||
},
|
|
||||||
cancel() {
|
|
||||||
this.$emit('cancel')
|
|
||||||
},
|
|
||||||
confirm() {
|
|
||||||
this.$emit('confirm')
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.mark {
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
|
||||||
left: 0;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.release {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.release_content {
|
|
||||||
width: 694rpx;
|
|
||||||
height: 137rpx;
|
|
||||||
background: #FCF3EE;
|
|
||||||
border-radius: 14rpx 14rpx 14rpx 14rpx;
|
|
||||||
opacity: 1;
|
|
||||||
margin-bottom: 21rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 26rpx;
|
|
||||||
|
|
||||||
.release_content_left {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.release_content_right {
|
|
||||||
height: 137rpx;
|
|
||||||
line-height: 137rpx;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.release_img {
|
|
||||||
width: 111rpx;
|
|
||||||
height: 96rpx;
|
|
||||||
margin-top: 21rpx;
|
|
||||||
margin-right: 19rpx;
|
|
||||||
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 111rpx;
|
|
||||||
height: 96rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.release_imga {
|
|
||||||
|
|
||||||
width: 76rpx;
|
|
||||||
height: 113rpx;
|
|
||||||
|
|
||||||
margin-top: 5rpx;
|
|
||||||
margin-right: 50rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 76rpx;
|
|
||||||
height: 113rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-top: 23rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title1 {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title2 {
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #666666;
|
|
||||||
margin-top: 11rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.release_close {
|
|
||||||
width: 248rpx;
|
|
||||||
height: 248rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 248rpx;
|
|
||||||
height: 248rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -132,13 +132,11 @@
|
|||||||
el.check = false
|
el.check = false
|
||||||
})
|
})
|
||||||
this.storeTypeList = [
|
this.storeTypeList = [
|
||||||
{name: '全部', value: 'trader',check: true},
|
{name: '全部', value: '',check: true},
|
||||||
{name: '自营', value: 'trader',check: false},
|
{name: '自营', value: 'trader',check: false},
|
||||||
{name: '非自营', value: 'trader',check: false}
|
{name: '非自营', value: 'trader',check: false}
|
||||||
]
|
]
|
||||||
this.min = this.max = ''
|
this.min = this.max = ''
|
||||||
this.is_trader=''
|
|
||||||
this.index=0
|
|
||||||
this.arrFilter()
|
this.arrFilter()
|
||||||
},
|
},
|
||||||
confirm(){
|
confirm(){
|
||||||
@ -148,8 +146,7 @@
|
|||||||
price_on:this.min,
|
price_on:this.min,
|
||||||
price_off:this.max,
|
price_off:this.max,
|
||||||
status:false,
|
status:false,
|
||||||
is_trader: this.is_trader,
|
is_trader: this.is_trader
|
||||||
|
|
||||||
}
|
}
|
||||||
this.showBox = false
|
this.showBox = false
|
||||||
this.$emit('confirm',obj,this.index)
|
this.$emit('confirm',obj,this.index)
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,607 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="containers" :style="viewColor">
|
|
||||||
<view class="header">
|
|
||||||
|
|
||||||
<view class="search">
|
|
||||||
<text class="iconfont icon-xiazai5"></text>
|
|
||||||
<input type="text" placeholder="请输入商品名称" v-model="searchVal" @input="setValue" confirm-type="search"
|
|
||||||
@confirm="searchBut()" placeholder-class='placeholder'>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="iconclose" @click="close">
|
|
||||||
<image src="@/static/images/wt_close.png" mode="aspectFit"></image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="main">
|
|
||||||
<scroll-view scroll-y="true" @touchmove.stop>
|
|
||||||
<block>
|
|
||||||
<view v-if="bought.length" @touchmove="onTouchmove" id="goods" class="goods">
|
|
||||||
<view class="picTxt acea-row" v-for="(item, i) in bought" :key="i">
|
|
||||||
<view class="checkbox">
|
|
||||||
<text @click.stop="goodsCheck(item)" v-if="item.check"
|
|
||||||
class="iconfont icon-xuanzhong1"></text>
|
|
||||||
<text @click.stop="goodsCheck(item)" v-else
|
|
||||||
:class="checkedArr.length >=5 ? 'disabled': ''"
|
|
||||||
class="iconfont icon-weixuanzhong"></text>
|
|
||||||
</view>
|
|
||||||
<view class='pictrue'>
|
|
||||||
<image :src='item.image'></image>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class='text'>
|
|
||||||
<view class='line2 name'>{{item.store_name}}</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="picTxt_one" v-if="item.attrValue.length>0">
|
|
||||||
<picker class="slecte" v-if="item.attrValue.length>1"
|
|
||||||
@change="bindPickerChange($event,item.attrValue,i)" :value="index"
|
|
||||||
:range="item.attrValue" :range-key="'sku'">
|
|
||||||
<view class="uni-input">{{item.attrValue[index].sku}}</view>
|
|
||||||
</picker>
|
|
||||||
|
|
||||||
<view class="" style="margin-top: 10rpx;">
|
|
||||||
库存:{{item.attrValue[index].stock}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="picTxt_price">
|
|
||||||
<view class="price">
|
|
||||||
<span>出售价格</span>
|
|
||||||
<input type="text" :value="item.price" placeholder="输入出售价格"
|
|
||||||
@input="producrprice($event,i,item)" adjust-position=""
|
|
||||||
placeholder-style="color: #CCCCCC;" />
|
|
||||||
</view>
|
|
||||||
<view class="price_num">
|
|
||||||
<span>出售数量</span>
|
|
||||||
<subtractive v-if='item.number==0' style="margin-top: 10rpx;margin-left: 20rpx;"
|
|
||||||
class="step" :min="0" :max="item.attrValue[index].stock" :value="peicenumber"
|
|
||||||
:isMax="true" :isMin="true" index="11" @eventChange="numberChange($event,i)">
|
|
||||||
</subtractive>
|
|
||||||
|
|
||||||
<subtractive v-else style="margin-top: 10rpx;margin-left: 20rpx;" class="step"
|
|
||||||
:min="0" :max="item.attrValue[index].stock" :value="item.number" :isMax="true"
|
|
||||||
:isMin="true" index="11" @increment="incrementTotal($event,i,item)"
|
|
||||||
@eventChange="numberChange($event,i)"></subtractive>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-else class="empty">
|
|
||||||
<image src="/static/images/no_thing.png"></image>
|
|
||||||
<text>暂无内容哦~</text>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
</scroll-view>
|
|
||||||
<view class="foot_bar">
|
|
||||||
<button class="confirm_btn" @click="submit">确定({{checkedArr.length}})</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Loading from '@/components/Loading/index.vue';
|
|
||||||
import subtractive from '@/components/subtractive/subtractive.vue';
|
|
||||||
|
|
||||||
import {
|
|
||||||
getCommunitygetOrderList
|
|
||||||
} from "@/api/trading-floor";
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
checkedObj: {
|
|
||||||
type: Array,
|
|
||||||
default: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: mapGetters(['viewColor']),
|
|
||||||
components: {
|
|
||||||
Loading,
|
|
||||||
subtractive
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isActive: 0,
|
|
||||||
loadedb: false,
|
|
||||||
loadingb: false,
|
|
||||||
loadedc: false,
|
|
||||||
loadingc: false,
|
|
||||||
loadeds: false,
|
|
||||||
loadings: false,
|
|
||||||
whereb: {
|
|
||||||
page: 1,
|
|
||||||
limit: 10,
|
|
||||||
keyword: '',
|
|
||||||
},
|
|
||||||
peicenumber: 0,
|
|
||||||
|
|
||||||
searchVal: "",
|
|
||||||
checked: [],
|
|
||||||
list: [],
|
|
||||||
|
|
||||||
bought: [],
|
|
||||||
|
|
||||||
checkedArr: [],
|
|
||||||
aryys: [],
|
|
||||||
// picker下拉数据源
|
|
||||||
storageCustomList: [{
|
|
||||||
CustGoodsCode: "TEST001",
|
|
||||||
CustGoodsName: "测试货主001",
|
|
||||||
IfBoxId: 0,
|
|
||||||
IfProductId: 0,
|
|
||||||
}, {
|
|
||||||
CustGoodsCode: "TEST002",
|
|
||||||
CustGoodsName: "测试货主002",
|
|
||||||
IfBoxId: 0,
|
|
||||||
IfProductId: 0,
|
|
||||||
}, {
|
|
||||||
CustGoodsCode: "TEST003",
|
|
||||||
CustGoodsName: "测试货主003",
|
|
||||||
IfBoxId: 0,
|
|
||||||
IfProductId: 0,
|
|
||||||
}],
|
|
||||||
index: 0,
|
|
||||||
pickerData: '请选择',
|
|
||||||
itstock: '',
|
|
||||||
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
checkedObj: {
|
|
||||||
handler(n) {
|
|
||||||
|
|
||||||
this.checkedArr = n
|
|
||||||
},
|
|
||||||
deep: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.checkedArr = this.checkedObj
|
|
||||||
this.aryys = this.checkedObj
|
|
||||||
this.getBounht();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//价格
|
|
||||||
producrprice(e, i, item) {
|
|
||||||
this.bought[i].price = e.detail.value
|
|
||||||
this.$set(item, 'check', false);
|
|
||||||
for (let i in this.checkedArr) {
|
|
||||||
if (this.checkedArr[i].product_id == item.product_id) {
|
|
||||||
this.checkedArr.splice(i, 1)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
incrementTotal(e, i, item) {
|
|
||||||
// console.log(e, i, item)
|
|
||||||
this.$set(item, 'check', false);
|
|
||||||
for (let i in this.checkedArr) {
|
|
||||||
if (this.checkedArr[i].product_id == item.product_id) {
|
|
||||||
this.checkedArr.splice(i, 1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
// picker修改事件
|
|
||||||
bindPickerChange: function(e, storage, num) {
|
|
||||||
this.bought[num].attrValue[this.index].sku = storage[e.detail.value].sku
|
|
||||||
this.bought[num].attrValue[this.index].stock = storage[e.detail.value].stock
|
|
||||||
this.bought[num].product_attr_unique = storage[e.detail.value].unique
|
|
||||||
this.pickerData = storage[this.index] // 这里就是选中的对象
|
|
||||||
if (this.bought[num].attrValue[this.index].stock == 0) {
|
|
||||||
this.$util.Tips({
|
|
||||||
title: '库存不足'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 点击关闭按钮
|
|
||||||
close() {
|
|
||||||
this.$emit('close');
|
|
||||||
},
|
|
||||||
numberChange(data, i) {
|
|
||||||
this.peicenumber = data.number;
|
|
||||||
this.bought[i].number = data.number
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
tabs(index) {
|
|
||||||
this.isActive = index
|
|
||||||
this.$set(this.whereb, 'keyword', '');
|
|
||||||
this.searchVal = ''
|
|
||||||
this.searchBut()
|
|
||||||
},
|
|
||||||
onTouchmove(e) {
|
|
||||||
if (this.loadendb) return;
|
|
||||||
if (this.loadingb) return;
|
|
||||||
const query = uni.createSelectorQuery().in(this);
|
|
||||||
query.select('#goods').boundingClientRect(data => {
|
|
||||||
if (data.bottom < 1500 && data.top < 0) {
|
|
||||||
this.getBounht();
|
|
||||||
}
|
|
||||||
}).exec();
|
|
||||||
|
|
||||||
// 模拟触底刷新
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
setValue: function(event) {
|
|
||||||
this.$set(this.whereb, 'keyword', event.detail.value);
|
|
||||||
if (!event.detail.value) {
|
|
||||||
this.whereb.page = 1
|
|
||||||
this.loadedb = false
|
|
||||||
this.getBounht()
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
searchBut() {
|
|
||||||
this.bought = []
|
|
||||||
this.whereb.page = 1
|
|
||||||
this.loadedb = false
|
|
||||||
this.getBounht()
|
|
||||||
},
|
|
||||||
getBounht() {
|
|
||||||
var that = this;
|
|
||||||
// console.log('1111111', that.loadingb, that.loadedb)
|
|
||||||
if (that.loadingb || that.loadedb) return;
|
|
||||||
that.loadingb = true;
|
|
||||||
|
|
||||||
getCommunitygetOrderList(that.whereb).then(
|
|
||||||
res => {
|
|
||||||
that.loadingb = false;
|
|
||||||
that.loadedb = res.data.list.length < that.whereb.limit;
|
|
||||||
that.bought.push.apply(that.bought, res.data.list);
|
|
||||||
that.whereb.page = that.whereb.page + 1;
|
|
||||||
that.getInitchecked(that.bought);
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
that.$util.Tips({
|
|
||||||
title: error.msg
|
|
||||||
})
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
/*获取初始化选中的数据*/
|
|
||||||
getInitchecked(arr) {
|
|
||||||
let that = this;
|
|
||||||
arr.forEach((item, index) => {
|
|
||||||
that.$set(item, 'check', false);
|
|
||||||
that.checkedArr.forEach((val, i) => {
|
|
||||||
if (item.product_id == val.product_id) {
|
|
||||||
that.$set(item, 'check', true);
|
|
||||||
that.$set(item, 'number', val.number);
|
|
||||||
that.$set(item, 'price', val.price);
|
|
||||||
that.peicenumber=val.number
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
/*已选中的商品打钩*/
|
|
||||||
getCheckedGoods() {
|
|
||||||
this.checked = []
|
|
||||||
this.checkedArr.forEach((item, index) => {
|
|
||||||
this.checkedArr.push(item)
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/*点击选中与否*/
|
|
||||||
goodsCheck(item) {
|
|
||||||
this.$set(item, 'check', !item.check);
|
|
||||||
if (item.check) {
|
|
||||||
|
|
||||||
if (this.peicenumber == 0) {
|
|
||||||
item.number = 1
|
|
||||||
}
|
|
||||||
if (!item.product_attr_unique) {
|
|
||||||
item.product_attr_unique = item.attrValue[0].unique
|
|
||||||
}
|
|
||||||
this.checkedArr.push(item)
|
|
||||||
} else {
|
|
||||||
this.checkedArr.splice(this.checkedArr.findIndex(itemn => ((itemn.product_id == item.product_id))), 1)
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/*确定提交*/
|
|
||||||
submit() {
|
|
||||||
|
|
||||||
this.$emit('getProduct', this.checkedArr);
|
|
||||||
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.containers {
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 16rpx 16rpx 0 0;
|
|
||||||
padding: 40rpx 0;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
position: relative;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
text {
|
|
||||||
position: relative;
|
|
||||||
margin: 0 50rpx;
|
|
||||||
color: #999999;
|
|
||||||
font-size: 30rpx;
|
|
||||||
|
|
||||||
&.on {
|
|
||||||
color: #333333;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 34rpx;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "";
|
|
||||||
display: inline-block;
|
|
||||||
width: 40rpx;
|
|
||||||
height: 5rpx;
|
|
||||||
background: var(--view-theme);
|
|
||||||
position: absolute;
|
|
||||||
bottom: -10rpx;
|
|
||||||
left: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconclose {
|
|
||||||
width: 44rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
line-height: 44rpx;
|
|
||||||
|
|
||||||
border-radius: 50%;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
top: -150rpx;
|
|
||||||
right: 30rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.search {
|
|
||||||
margin-top: 44rpx;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border-radius: 30rpx;
|
|
||||||
padding: 12rpx 30rpx 12rpx 66rpx;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #939393;
|
|
||||||
position: absolute;
|
|
||||||
top: 20rpx;
|
|
||||||
left: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
color: #999999;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub_title {
|
|
||||||
color: #282828;
|
|
||||||
font-size: 26rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #8A8A8A;
|
|
||||||
font-size: 28rpx;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scroll-view {
|
|
||||||
height: 650rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.main {
|
|
||||||
height: 650rpx;
|
|
||||||
margin: 40rpx 0 80rpx;
|
|
||||||
padding: 0 30rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.picTxt {
|
|
||||||
width: 100%;
|
|
||||||
padding: 25rpx 0;
|
|
||||||
position: relative;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
border-top: 2rpx solid #E7E6E4;
|
|
||||||
|
|
||||||
.picTxt_one {
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.picTxt_one {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
|
|
||||||
|
|
||||||
.slecte {
|
|
||||||
margin-right: 30rpx;
|
|
||||||
width: 280rpx;
|
|
||||||
height: 60rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #959595;
|
|
||||||
background-color: #E7E6E4;
|
|
||||||
border-radius: 10rpx 10rpx 10rpx 10rpx;
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.picTxt_price {
|
|
||||||
display: flex;
|
|
||||||
margin-top: 37rpx;
|
|
||||||
height: 70rpx;
|
|
||||||
line-height: 70rpx;
|
|
||||||
|
|
||||||
.price {
|
|
||||||
display: flex;
|
|
||||||
margin-right: 15rpx;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 210rpx;
|
|
||||||
text-align: center;
|
|
||||||
height: 70rpx;
|
|
||||||
background: #F5F5F5;
|
|
||||||
border-radius: 7rpx 7rpx 7rpx 7rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
|
|
||||||
margin-left: 20rpx;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.price_num {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.checkbox {
|
|
||||||
margin-right: 30rpx;
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-size: 38rpx;
|
|
||||||
color: #CCCCCC;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-xuanzhong1 {
|
|
||||||
color: var(--view-theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
|
||||||
pointer-events: none;
|
|
||||||
cursor: default;
|
|
||||||
opacity: 0.3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.pictrue {
|
|
||||||
width: 160rpx;
|
|
||||||
height: 160rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 8rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 430rpx;
|
|
||||||
margin-left: 30rpx;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #282828;
|
|
||||||
position: relative;
|
|
||||||
height: 160rpx;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
color: #282828;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.money {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
color: var(--view-priceColor);
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.foot_bar {
|
|
||||||
width: 100%;
|
|
||||||
position: fixed;
|
|
||||||
// bottom: 54px;
|
|
||||||
left: 0;
|
|
||||||
padding: 20rpx 0;
|
|
||||||
z-index: 5;
|
|
||||||
|
|
||||||
.confirm_btn {
|
|
||||||
width: 710rpx;
|
|
||||||
height: 86rpx;
|
|
||||||
line-height: 86rpx;
|
|
||||||
color: #ffffff;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 32rpx;
|
|
||||||
background: var(--view-theme);
|
|
||||||
border-radius: 43rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
|
||||||
margin: 130rpx 0 150rpx;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
image,
|
|
||||||
uni-image {
|
|
||||||
display: inline-block;
|
|
||||||
width: 414rpx;
|
|
||||||
height: 305rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
color: #999999;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,518 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<uni-popup ref="popupRef" type="bottom" @change="changeShow">
|
|
||||||
<view class="pop">
|
|
||||||
<scroll-view scroll-y class="scroll">
|
|
||||||
<view class="image">
|
|
||||||
<swiper class="swiper" :current="current" autoplay style="width: 100%;height: 100%;" @change="changeCurrent">
|
|
||||||
<block v-if="product.slider_image && product.slider_image.length>0">
|
|
||||||
<swiper-item v-for="(item,index) in product.slider_image" :key="index">
|
|
||||||
<image class="img" :src="item"></image>
|
|
||||||
</swiper-item>
|
|
||||||
</block>
|
|
||||||
<swiper-item v-else>
|
|
||||||
<image class="img" :src="datas.image||defualtImg"></image>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
<view class="current">{{current+1}}/{{product.slider_image && product.slider_image.length||1}}</view>
|
|
||||||
<image class="close" src="@/static/images/icon/close.png" @click="close()"></image>
|
|
||||||
<view class="border"></view>
|
|
||||||
</view>
|
|
||||||
<view class="white_card">
|
|
||||||
<view class="flex flex_end">
|
|
||||||
<view class="price">¥<text class="pro">{{leftPrice}}.</text>{{rightPrice}}
|
|
||||||
</view>
|
|
||||||
<!-- <view>订货价</view> -->
|
|
||||||
</view>
|
|
||||||
<view class="short_name">{{datas.store_name}}</view>
|
|
||||||
<view class="flex">
|
|
||||||
<view class="shop_name">
|
|
||||||
<image class="icon" src="@/static/images/icon/short.png"></image>
|
|
||||||
<view>{{datas.merchant.mer_name}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<u-line></u-line>
|
|
||||||
<block name="规格选中" v-for="(att, indexw) in attr" :key="indexw">
|
|
||||||
<view class="m_title">{{att.attr_name}}</view>
|
|
||||||
<view class="flex" style="flex-wrap: wrap;">
|
|
||||||
<view class="attr" :class="{'attr_active': item.check}"
|
|
||||||
v-for="(item, indexn) in att.attr_value" :key="indexn"
|
|
||||||
@click="changeAttr(indexw, indexn)">
|
|
||||||
{{item.attr}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<view class="m_title num">
|
|
||||||
<view>购买数量</view>
|
|
||||||
<view class="input">
|
|
||||||
<view class="input_item sub" @click="subCartNum">-</view>
|
|
||||||
<input class="input_item input_view" v-model="cart_num" type="number" @input="inputCartNum" />
|
|
||||||
<view class="input_item plus" @click="plusCartNum">+</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
商品库存 <text style="margin-left: 20rpx;">{{(sku[changeSkuKey] && sku[changeSkuKey].stock)||change.stock}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<view class="button">
|
|
||||||
<view class="b_icon" @click="navgoCart()">
|
|
||||||
<image src="@/static/images/icon/car.png"></image>
|
|
||||||
<view>购物车</view>
|
|
||||||
<view class="badge" v-if="goodsNum">{{goodsNum}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn" @click.stop="$u.throttle(addcart, 1500)"> {{isBuy?'立即购买':'加入购物车'}} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</uni-popup>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
postCartAdd,
|
|
||||||
getProductDetail
|
|
||||||
} from '@/api/store.js';
|
|
||||||
export default {
|
|
||||||
name: "shortPopup",
|
|
||||||
props: {
|
|
||||||
source:{
|
|
||||||
type: Number,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
isBuy: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isShow: false, //当前是否打开弹窗
|
|
||||||
defualtImg: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230130/00ebcfdf75684f5494c0193075055d1.png',
|
|
||||||
datas: {
|
|
||||||
image: '',
|
|
||||||
store_name: '',
|
|
||||||
merchant: {
|
|
||||||
mer_name: ''
|
|
||||||
},
|
|
||||||
price: '',
|
|
||||||
},
|
|
||||||
product: {},
|
|
||||||
attrValue: [],
|
|
||||||
attr: [], //多级规格
|
|
||||||
changeSkuKey: '', //多级规格选中的key
|
|
||||||
sku: {}, //规格
|
|
||||||
sku_key_list: [], //规格名称列表
|
|
||||||
changeSkuKey: '', //选中的规格名称
|
|
||||||
change: {
|
|
||||||
stock: ''
|
|
||||||
},
|
|
||||||
cart_num: 1, //购买数量
|
|
||||||
goodsNum: 0, //购物车数量
|
|
||||||
current: 0, //轮播图当前滑块
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
computed:{
|
|
||||||
leftPrice(){
|
|
||||||
return this.sku[this.changeSkuKey]?.price?.split('.')[0]||'0';
|
|
||||||
},
|
|
||||||
rightPrice(){
|
|
||||||
return this.sku[this.changeSkuKey]?.price?.split('.')[1]||'00';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 注入参数,
|
|
||||||
setDatas(datas, goodsNum) {
|
|
||||||
getProductDetail(datas.product_id).then((res)=>{
|
|
||||||
this.attr = res.data.attr;
|
|
||||||
if(this.attr.length>0) this.attr.forEach((item, index)=>{
|
|
||||||
this.changeAttr(index, 0);
|
|
||||||
})
|
|
||||||
else this.changeSkuKey = '';
|
|
||||||
})
|
|
||||||
this.goodsNum = goodsNum;
|
|
||||||
this.datas = datas;
|
|
||||||
this.product = datas.product;
|
|
||||||
this.attrValue = datas.product?.attrValue;
|
|
||||||
this.change = this.attrValue[0];
|
|
||||||
this.cart_num = 1;
|
|
||||||
this.sku = datas.sku||{};
|
|
||||||
this.sku_key_list = Object.keys(this.sku);
|
|
||||||
},
|
|
||||||
// 输入购买数量
|
|
||||||
inputCartNum(e) {
|
|
||||||
if(this.sku){
|
|
||||||
if (+e.detail.value > this.sku[this.changeSkuKey].stock) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.cart_num = this.sku[this.changeSkuKey].stock;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}else if (this.change.stock <= this.cart_num) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.cart_num = this.change.stock;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 减少购买数量
|
|
||||||
subCartNum() {
|
|
||||||
if (this.cart_num <= 1) {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '最少要买一件哦'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.cart_num--;
|
|
||||||
},
|
|
||||||
// 增加购买数量
|
|
||||||
plusCartNum() {
|
|
||||||
if(this.sku){
|
|
||||||
if (this.sku[this.changeSkuKey].stock <= this.cart_num) {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}else if (this.change.stock <= this.cart_num) {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.cart_num++;
|
|
||||||
},
|
|
||||||
changeAttr: function(indexw, indexn) {
|
|
||||||
let that = this;
|
|
||||||
this.$set(this.attr[indexw], 'index', this.attr[indexw].attr_values[indexn]);
|
|
||||||
this.attr[indexw].attr_value.forEach((item, index)=>{
|
|
||||||
if(index==indexn)item.check = true;
|
|
||||||
else item.check = false;
|
|
||||||
})
|
|
||||||
let value = that.getCheckedValue().join(",");
|
|
||||||
this.changeSkuKey = value;
|
|
||||||
},
|
|
||||||
//获取被选中属性;
|
|
||||||
getCheckedValue: function() {
|
|
||||||
let productAttr = this.attr;
|
|
||||||
let value = [];
|
|
||||||
for (let i = 0; i < productAttr.length; i++) {
|
|
||||||
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
|
|
||||||
if (productAttr[i].index === productAttr[i].attr_values[j]) {
|
|
||||||
value.push(productAttr[i].attr_values[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
},
|
|
||||||
// 加入购物车
|
|
||||||
addcart() {
|
|
||||||
if (this.sku[this.changeSkuKey]) {
|
|
||||||
if (this.cart_num > this.sku[this.changeSkuKey].stock) return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
let data = {
|
|
||||||
cart_num: this.cart_num,
|
|
||||||
is_new: 0,
|
|
||||||
product_attr_unique: this.sku[this.changeSkuKey].unique,
|
|
||||||
product_id: this.datas.product_id,
|
|
||||||
product_type: this.datas.product_type,
|
|
||||||
source: this.source,
|
|
||||||
spread_id: "",
|
|
||||||
}
|
|
||||||
let that = this
|
|
||||||
let res = postCartAdd({
|
|
||||||
...data
|
|
||||||
}).then((res, err) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "加入成功",
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
this.$emit('addCart');
|
|
||||||
this.close();
|
|
||||||
if(this.isBuy){
|
|
||||||
this.navgoCart();
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
title: err,
|
|
||||||
icon: "none",
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '商品规格不存在'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 滑动轮播图
|
|
||||||
changeCurrent(e){
|
|
||||||
this.current = e.detail.current;
|
|
||||||
},
|
|
||||||
navgoCart(url=null) {
|
|
||||||
if(!url) {
|
|
||||||
if(this.source) url = '/pages/order_addcart/order_addcart?source='+this.source;
|
|
||||||
else url = '/pages/order_addcart/order_addcart';
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.$refs.popupRef.open();
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.$refs.popupRef.close();
|
|
||||||
},
|
|
||||||
changeShow(e) {
|
|
||||||
this.isShow = e.show;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.pop {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.scroll{
|
|
||||||
height: calc(90vh - 150rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex_end {
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.image {
|
|
||||||
height: 750rpx;
|
|
||||||
width: 750rpx;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.current{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 70rpx;
|
|
||||||
left: 30rpx;
|
|
||||||
width: 67rpx;
|
|
||||||
height: 37rpx;
|
|
||||||
background: rgba(#333, 0.2);
|
|
||||||
border-radius: 11rpx 11rpx 11rpx 11rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 26rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close {
|
|
||||||
position: absolute;
|
|
||||||
top: 30rpx;
|
|
||||||
right: 30rpx;
|
|
||||||
width: 50.82rpx;
|
|
||||||
height: 50.82rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border {
|
|
||||||
position: absolute;
|
|
||||||
bottom: -1rpx;
|
|
||||||
left: 0;
|
|
||||||
background-color: #fff;
|
|
||||||
height: 40rpx;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 40rpx 40rpx 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.white_card {
|
|
||||||
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
margin: 0 28rpx;
|
|
||||||
padding-bottom: 30rpx;
|
|
||||||
color: #737373;
|
|
||||||
font-size: 26.29rpx;
|
|
||||||
|
|
||||||
.price {
|
|
||||||
font-size: 35rpx;
|
|
||||||
font-family: SF Pro Display-Semibold, SF Pro Display;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #F84221;
|
|
||||||
padding-right: 30rpx;
|
|
||||||
|
|
||||||
.pro {
|
|
||||||
font-size: 49.07rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.short_name {
|
|
||||||
font-size: 33rpx;
|
|
||||||
font-family: PingFang SC-Semibold, PingFang SC;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_name {
|
|
||||||
display: flex;
|
|
||||||
background: #FEF5F3;
|
|
||||||
padding: 0 16rpx;
|
|
||||||
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 31.54rpx;
|
|
||||||
height: 31.54rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.m_title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
margin-top: 31rpx;
|
|
||||||
margin-bottom: 21rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attr {
|
|
||||||
opacity: 1;
|
|
||||||
border: 1rpx solid #F84221;
|
|
||||||
color: #333333;
|
|
||||||
padding: 15rpx 30rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
height: 63rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
border-radius: 63rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attr_active{
|
|
||||||
// background-color: #FEF5F3;
|
|
||||||
// color: #F84221;
|
|
||||||
background-color: #F84221;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.input {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 48rpx;
|
|
||||||
|
|
||||||
.input_item {
|
|
||||||
width: 44rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 40rpx;
|
|
||||||
border: 2rpx solid #fff;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input_view {
|
|
||||||
width: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub {
|
|
||||||
border: 2rpx solid #FCB9AD;
|
|
||||||
border-radius: 7rpx 0rpx 0rpx 7rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #B3B3B3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.plus {
|
|
||||||
border: 2rpx solid #FCB9AD;
|
|
||||||
border-radius: 0rpx 7rpx 7rpx 0rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #B3B3B3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
padding: 28rpx;
|
|
||||||
margin-bottom: 28rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
|
||||||
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
|
||||||
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
|
||||||
|
|
||||||
.b_icon {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 19rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #333333;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 50.82rpx;
|
|
||||||
height: 50.82rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
position: absolute;
|
|
||||||
top: -5rpx;
|
|
||||||
right: -10rpx;
|
|
||||||
color: #fff;
|
|
||||||
min-width: 28rpx;
|
|
||||||
height: 28rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 24rpx;
|
|
||||||
background: #F84221;
|
|
||||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
|
||||||
border: 2rpx solid #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 575rpx;
|
|
||||||
height: 84rpx;
|
|
||||||
background: linear-gradient(270deg, #FF6D20 0%, #F84221 100%);
|
|
||||||
border-radius: 42rpx 42rpx 42rpx 42rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,534 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
<uni-popup ref="popupRef" type="bottom" @change="changeShow">
|
|
||||||
<view class="pop">
|
|
||||||
<scroll-view scroll-y class="scroll">
|
|
||||||
<view class="image">
|
|
||||||
<swiper class="swiper" :current="current" autoplay style="width: 100%;height: 100%;" @change="changeCurrent">
|
|
||||||
<block v-if="product.slider_image && product.slider_image.length>0">
|
|
||||||
<swiper-item v-for="(item,index) in product.slider_image" :key="index">
|
|
||||||
<image class="img" :src="item"></image>
|
|
||||||
</swiper-item>
|
|
||||||
</block>
|
|
||||||
<swiper-item v-else>
|
|
||||||
<image class="img" :src="datas.image||defualtImg"></image>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
<view class="current">{{current+1}}/{{product.slider_image && product.slider_image.length||1}}</view>
|
|
||||||
<image class="close" src="@/static/images/icon/close.png" @click="close()"></image>
|
|
||||||
<view class="border"></view>
|
|
||||||
</view>
|
|
||||||
<view class="white_card">
|
|
||||||
<view class="flex flex_end">
|
|
||||||
<block v-if="datas.limited_price">
|
|
||||||
<view class="price">¥<text class="pro">{{leftPrice2}}.</text>{{rightPrice2}}
|
|
||||||
</view>
|
|
||||||
<view class="price" style="text-decoration: line-through;color: #999;font-weight: 400;font-size: 28rpx;">原价: ¥<text>{{leftPrice}}.</text>{{rightPrice}}</view>
|
|
||||||
</block>
|
|
||||||
<view v-else class="price">¥<text>{{leftPrice}}.</text>{{rightPrice}}</view>
|
|
||||||
<!-- <view>订货价</view> -->
|
|
||||||
</view>
|
|
||||||
<view class="short_name">{{datas.store_name}}</view>
|
|
||||||
<view class="flex">
|
|
||||||
<view class="shop_name">
|
|
||||||
<image class="icon" src="@/static/images/icon/short.png"></image>
|
|
||||||
<view>{{datas.merchant.mer_name}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<u-line></u-line>
|
|
||||||
<block name="规格选中" v-for="(att, indexw) in attr" :key="indexw">
|
|
||||||
<view class="m_title">{{att.attr_name}}</view>
|
|
||||||
<view class="flex" style="flex-wrap: wrap;">
|
|
||||||
<view class="attr" :class="{'attr_active': item.check}"
|
|
||||||
v-for="(item, indexn) in att.attr_value" :key="indexn"
|
|
||||||
@click="changeAttr(indexw, indexn)">
|
|
||||||
{{item.attr}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
<view class="m_title num">
|
|
||||||
<view>购买数量</view>
|
|
||||||
<view class="input">
|
|
||||||
<view class="input_item sub" @click="subCartNum">-</view>
|
|
||||||
<input class="input_item input_view" v-model="cart_num" type="number" @input="inputCartNum" />
|
|
||||||
<view class="input_item plus" @click="plusCartNum">+</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
商品库存 <text style="margin-left: 20rpx;">{{(sku[changeSkuKey] && sku[changeSkuKey].stock)||change.stock}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
<view class="button">
|
|
||||||
<!-- <view class="b_icon" @click="navgoCart()">
|
|
||||||
<image src="@/static/images/icon/car.png"></image>
|
|
||||||
<view>购物车</view>
|
|
||||||
<view class="badge" v-if="goodsNum">{{goodsNum}}</view>
|
|
||||||
</view> -->
|
|
||||||
<view class="btn" @click.stop="$u.throttle(addcart, 1500)"> {{isBuy?'立即购买':'加入购物车'}} </view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</uni-popup>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
postCartAdd,
|
|
||||||
getProductDetail
|
|
||||||
} from '@/api/store.js';
|
|
||||||
import { Toast } from '../libs/uniApi';
|
|
||||||
import { data } from '../uni_modules/uview-ui/libs/mixin/mixin';
|
|
||||||
export default {
|
|
||||||
name: "shortPopup",
|
|
||||||
props: {
|
|
||||||
source:{
|
|
||||||
type: Number,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
isBuy: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isShow: false, //当前是否打开弹窗
|
|
||||||
defualtImg: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230130/00ebcfdf75684f5494c0193075055d1.png',
|
|
||||||
datas: {
|
|
||||||
image: '',
|
|
||||||
store_name: '',
|
|
||||||
merchant: {
|
|
||||||
mer_name: ''
|
|
||||||
},
|
|
||||||
price: '',
|
|
||||||
},
|
|
||||||
product: {},
|
|
||||||
attrValue: [],
|
|
||||||
attr: [], //多级规格
|
|
||||||
changeSkuKey: '', //多级规格选中的key
|
|
||||||
sku: {}, //规格
|
|
||||||
sku_key_list: [], //规格名称列表
|
|
||||||
changeSkuKey: '', //选中的规格名称
|
|
||||||
change: {
|
|
||||||
stock: ''
|
|
||||||
},
|
|
||||||
cart_num: 1, //购买数量
|
|
||||||
goodsNum: 0, //购物车数量
|
|
||||||
current: 0, //轮播图当前滑块
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {},
|
|
||||||
computed:{
|
|
||||||
leftPrice(){
|
|
||||||
return this.sku[this.changeSkuKey]?.price?.split('.')[0]||'0';
|
|
||||||
},
|
|
||||||
rightPrice(){
|
|
||||||
return this.sku[this.changeSkuKey]?.price?.split('.')[1]||'00';
|
|
||||||
},
|
|
||||||
leftPrice2(){
|
|
||||||
return this.datas.limited_price.split('.')[0]||'0';
|
|
||||||
},
|
|
||||||
rightPrice2(){
|
|
||||||
return this.datas.limited_price.split('.')[1]||'00';
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 注入参数,
|
|
||||||
setDatas(datas, goodsNum) {
|
|
||||||
getProductDetail(datas.product_id).then((res)=>{
|
|
||||||
this.attr = res.data.attr;
|
|
||||||
if(this.attr.length>0) this.attr.forEach((item, index)=>{
|
|
||||||
this.changeAttr(index, 0);
|
|
||||||
})
|
|
||||||
else this.changeSkuKey = '';
|
|
||||||
})
|
|
||||||
this.goodsNum = goodsNum;
|
|
||||||
this.datas = datas;
|
|
||||||
this.product = datas.product;
|
|
||||||
this.attrValue = datas.product?.attrValue;
|
|
||||||
this.change = this.attrValue[0];
|
|
||||||
this.cart_num = 1;
|
|
||||||
this.sku = datas.sku||{};
|
|
||||||
this.sku_key_list = Object.keys(this.sku);
|
|
||||||
},
|
|
||||||
// 输入购买数量
|
|
||||||
inputCartNum(e) {
|
|
||||||
if(this.sku){
|
|
||||||
if (+e.detail.value > this.sku[this.changeSkuKey].stock) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.cart_num = this.sku[this.changeSkuKey].stock;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}else if (this.change.stock <= this.cart_num) {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.cart_num = this.change.stock;
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 减少购买数量
|
|
||||||
subCartNum() {
|
|
||||||
if (this.cart_num <= 1) {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '最少要买一件哦'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.cart_num--;
|
|
||||||
},
|
|
||||||
// 增加购买数量
|
|
||||||
plusCartNum() {
|
|
||||||
return Toast('最多购买一件哦');
|
|
||||||
if(this.sku){
|
|
||||||
if (this.sku[this.changeSkuKey].stock <= this.cart_num) {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}else if (this.change.stock <= this.cart_num) {
|
|
||||||
return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.cart_num++;
|
|
||||||
},
|
|
||||||
changeAttr: function(indexw, indexn) {
|
|
||||||
let that = this;
|
|
||||||
this.$set(this.attr[indexw], 'index', this.attr[indexw].attr_values[indexn]);
|
|
||||||
this.attr[indexw].attr_value.forEach((item, index)=>{
|
|
||||||
if(index==indexn)item.check = true;
|
|
||||||
else item.check = false;
|
|
||||||
})
|
|
||||||
let value = that.getCheckedValue().join(",");
|
|
||||||
this.changeSkuKey = value;
|
|
||||||
},
|
|
||||||
//获取被选中属性;
|
|
||||||
getCheckedValue: function() {
|
|
||||||
let productAttr = this.attr;
|
|
||||||
let value = [];
|
|
||||||
for (let i = 0; i < productAttr.length; i++) {
|
|
||||||
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
|
|
||||||
if (productAttr[i].index === productAttr[i].attr_values[j]) {
|
|
||||||
value.push(productAttr[i].attr_values[j]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
},
|
|
||||||
// 加入购物车
|
|
||||||
addcart() {
|
|
||||||
if (this.sku[this.changeSkuKey]) {
|
|
||||||
if (this.cart_num > this.sku[this.changeSkuKey].stock) return uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '不能超出库存哦'
|
|
||||||
})
|
|
||||||
let data = {
|
|
||||||
cart_num: this.cart_num,
|
|
||||||
is_new: 0,
|
|
||||||
product_attr_unique: this.sku[this.changeSkuKey].unique,
|
|
||||||
product_id: this.datas.product_id,
|
|
||||||
product_type: this.datas.product_type,
|
|
||||||
source: this.source,
|
|
||||||
spread_id: "",
|
|
||||||
}
|
|
||||||
let that = this
|
|
||||||
let res = postCartAdd({
|
|
||||||
...data
|
|
||||||
}).then((res, err) => {
|
|
||||||
if(this.isBuy) return uni.navigateTo({
|
|
||||||
url: `/pages/users/order_confirm/index?cartId=${res.data.cart_id}&type_id=${this.datas.merchant.type_id}&source=${this.source}`
|
|
||||||
});
|
|
||||||
uni.showToast({
|
|
||||||
title: "加入成功",
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
this.$emit('addCart');
|
|
||||||
this.close();
|
|
||||||
if(this.isBuy){
|
|
||||||
this.navgoCart();
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
|
||||||
uni.showToast({
|
|
||||||
title: err,
|
|
||||||
icon: "none",
|
|
||||||
duration: 1000,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '商品规格不存在'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 滑动轮播图
|
|
||||||
changeCurrent(e){
|
|
||||||
this.current = e.detail.current;
|
|
||||||
},
|
|
||||||
navgoCart(url=null) {
|
|
||||||
if(!url) {
|
|
||||||
if(this.source) url = '/pages/order_addcart/order_addcart?source='+this.source;
|
|
||||||
else url = '/pages/order_addcart/order_addcart';
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.$refs.popupRef.open();
|
|
||||||
},
|
|
||||||
close() {
|
|
||||||
this.$refs.popupRef.close();
|
|
||||||
},
|
|
||||||
changeShow(e) {
|
|
||||||
this.isShow = e.show;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.pop {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.scroll{
|
|
||||||
height: calc(90vh - 150rpx);
|
|
||||||
}
|
|
||||||
|
|
||||||
.flex_end {
|
|
||||||
align-items: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.image {
|
|
||||||
height: 750rpx;
|
|
||||||
width: 750rpx;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.current{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 70rpx;
|
|
||||||
left: 30rpx;
|
|
||||||
width: 67rpx;
|
|
||||||
height: 37rpx;
|
|
||||||
background: rgba(#333, 0.2);
|
|
||||||
border-radius: 11rpx 11rpx 11rpx 11rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 26rpx;
|
|
||||||
font-family: PingFang SC-Regular, PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
.img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close {
|
|
||||||
position: absolute;
|
|
||||||
top: 30rpx;
|
|
||||||
right: 30rpx;
|
|
||||||
width: 50.82rpx;
|
|
||||||
height: 50.82rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border {
|
|
||||||
position: absolute;
|
|
||||||
bottom: -1rpx;
|
|
||||||
left: 0;
|
|
||||||
background-color: #fff;
|
|
||||||
height: 40rpx;
|
|
||||||
width: 100%;
|
|
||||||
border-radius: 40rpx 40rpx 0 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.white_card {
|
|
||||||
border-radius: 31.54rpx 31.54rpx 0rpx 0rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
margin: 0 28rpx;
|
|
||||||
padding-bottom: 30rpx;
|
|
||||||
color: #737373;
|
|
||||||
font-size: 26.29rpx;
|
|
||||||
|
|
||||||
.price {
|
|
||||||
font-size: 35rpx;
|
|
||||||
font-family: SF Pro Display-Semibold, SF Pro Display;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #F84221;
|
|
||||||
padding-right: 30rpx;
|
|
||||||
|
|
||||||
.pro {
|
|
||||||
font-size: 49.07rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.short_name {
|
|
||||||
font-size: 33rpx;
|
|
||||||
font-family: PingFang SC-Semibold, PingFang SC;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.shop_name {
|
|
||||||
display: flex;
|
|
||||||
background: #FEF5F3;
|
|
||||||
padding: 0 16rpx;
|
|
||||||
border-radius: 26rpx 26rpx 26rpx 26rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 31.54rpx;
|
|
||||||
height: 31.54rpx;
|
|
||||||
margin-right: 10rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.m_title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333333;
|
|
||||||
margin-top: 31rpx;
|
|
||||||
margin-bottom: 21rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attr {
|
|
||||||
opacity: 1;
|
|
||||||
border: 1rpx solid #F84221;
|
|
||||||
color: #333333;
|
|
||||||
padding: 15rpx 30rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
height: 63rpx;
|
|
||||||
line-height: 60rpx;
|
|
||||||
border-radius: 63rpx;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.attr_active{
|
|
||||||
// background-color: #FEF5F3;
|
|
||||||
// color: #F84221;
|
|
||||||
background-color: #F84221;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.num {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.input {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 48rpx;
|
|
||||||
|
|
||||||
.input_item {
|
|
||||||
width: 44rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 40rpx;
|
|
||||||
border: 2rpx solid #fff;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input_view {
|
|
||||||
width: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub {
|
|
||||||
border: 2rpx solid #FCB9AD;
|
|
||||||
border-radius: 7rpx 0rpx 0rpx 7rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #B3B3B3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.plus {
|
|
||||||
border: 2rpx solid #FCB9AD;
|
|
||||||
border-radius: 0rpx 7rpx 7rpx 0rpx;
|
|
||||||
background: #FFFFFF;
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #B3B3B3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
padding: 28rpx;
|
|
||||||
margin-bottom: 28rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-around;
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
|
||||||
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom); ///兼容 IOS<11.2/
|
|
||||||
padding-bottom: env(safe-area-inset-bottom); ///兼容 IOS>11.2/
|
|
||||||
|
|
||||||
.b_icon {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 19rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #333333;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 50.82rpx;
|
|
||||||
height: 50.82rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
position: absolute;
|
|
||||||
top: -5rpx;
|
|
||||||
right: -10rpx;
|
|
||||||
color: #fff;
|
|
||||||
min-width: 28rpx;
|
|
||||||
height: 28rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 24rpx;
|
|
||||||
background: #F84221;
|
|
||||||
border-radius: 16rpx 16rpx 16rpx 16rpx;
|
|
||||||
border: 2rpx solid #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: 575rpx;
|
|
||||||
height: 84rpx;
|
|
||||||
background: linear-gradient(270deg, #FF6D20 0%, #F84221 100%);
|
|
||||||
border-radius: 42rpx 42rpx 42rpx 42rpx;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-family: PingFang SC-Medium, PingFang SC;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,217 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="uni-numbox">
|
|
||||||
<!-- -部分 -->
|
|
||||||
<view class="uni-numbox-minus" @click="_calcValue('subtract')">
|
|
||||||
<text :class="minDisabled?'uni-numbox-disabled': ''">-</text>
|
|
||||||
</view>
|
|
||||||
<!-- 中间输入数值部分 -->
|
|
||||||
<input class="uni-numbox-value" type="number" :disabled="disabled" :value="inputValue" @blur="_onBlur">
|
|
||||||
<!-- + 部分 -->
|
|
||||||
<view class="uni-numbox-plus" @click="_calcValue('add')">
|
|
||||||
<text :class="maxDisabled?'uni-numbox-disabled': ''">+</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'uni-number-box',
|
|
||||||
props: {
|
|
||||||
// isMax 是否有上限设置
|
|
||||||
isMax: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// isMin 是否有下限设置
|
|
||||||
isMin: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// index 唯一值,如果一个页面有多个数量增减组件时,起到唯一的作用
|
|
||||||
index: {
|
|
||||||
type: String,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
// value 是数值
|
|
||||||
value: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
// min 最小值
|
|
||||||
min: {
|
|
||||||
type: Number,
|
|
||||||
default: -Infinity
|
|
||||||
},
|
|
||||||
// max 最大值
|
|
||||||
max: {
|
|
||||||
type: Number,
|
|
||||||
default: Infinity
|
|
||||||
},
|
|
||||||
// step 步长
|
|
||||||
step: {
|
|
||||||
type: Number,
|
|
||||||
default: 1
|
|
||||||
},
|
|
||||||
// disabled 是否禁用
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
inputValue: this.value,
|
|
||||||
minDisabled: false,
|
|
||||||
maxDisabled: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.maxDisabled = this.isMax;
|
|
||||||
this.minDisabled = this.isMin;
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
inputValue(number) {
|
|
||||||
const data = {
|
|
||||||
number: number,
|
|
||||||
index: this.index
|
|
||||||
}
|
|
||||||
this.$emit('eventChange', data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
_calcValue(type) {
|
|
||||||
const scale = this._getDecimalScale();
|
|
||||||
let value = this.inputValue * scale;
|
|
||||||
let newValue = 0;
|
|
||||||
let step = this.step * scale;
|
|
||||||
|
|
||||||
if (type === 'subtract') {
|
|
||||||
newValue = value - step;
|
|
||||||
if (newValue <= this.min) {
|
|
||||||
this.minDisabled = true;
|
|
||||||
}
|
|
||||||
if (newValue < this.min) {
|
|
||||||
newValue = this.min
|
|
||||||
this.$util.Tips({
|
|
||||||
title: '达到最小值了',
|
|
||||||
icon: 'error'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (newValue < this.max && this.maxDisabled === true) {
|
|
||||||
this.maxDisabled = false;
|
|
||||||
}
|
|
||||||
} else if (type === 'add') {
|
|
||||||
newValue = value + step;
|
|
||||||
if (newValue >= this.max) {
|
|
||||||
this.maxDisabled = true;
|
|
||||||
}
|
|
||||||
if (newValue > this.max) {
|
|
||||||
this.$util.Tips({
|
|
||||||
title: '达到最大值了',
|
|
||||||
icon: 'error'
|
|
||||||
})
|
|
||||||
newValue = this.max
|
|
||||||
}
|
|
||||||
if (newValue > this.min && this.minDisabled === true) {
|
|
||||||
this.minDisabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (newValue === value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.inputValue = newValue / scale;
|
|
||||||
this.$emit('increment', this.inputValue)
|
|
||||||
},
|
|
||||||
_getDecimalScale() {
|
|
||||||
let scale = 1;
|
|
||||||
// 浮点型
|
|
||||||
if (~~this.step !== this.step) {
|
|
||||||
scale = Math.pow(10, (this.step + '').split('.')[1].length);
|
|
||||||
}
|
|
||||||
return scale;
|
|
||||||
},
|
|
||||||
_onBlur(event) {
|
|
||||||
let value = event.detail.value;
|
|
||||||
if (!value) {
|
|
||||||
this.inputValue = 0;
|
|
||||||
return
|
|
||||||
}
|
|
||||||
value = +value;
|
|
||||||
if (value > this.max) {
|
|
||||||
value = this.max;
|
|
||||||
} else if (value < this.min) {
|
|
||||||
value = this.min
|
|
||||||
}
|
|
||||||
|
|
||||||
this.inputValue = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.uni-numbox {
|
|
||||||
/* position:absolute; */
|
|
||||||
/* left: 30upx;
|
|
||||||
bottom: 0; */
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
width: 200upx;
|
|
||||||
height: 50upx;
|
|
||||||
/* background:#f5f5f5; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-minus {
|
|
||||||
background: #EEEEEE !important;
|
|
||||||
|
|
||||||
color: #909399 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-minus,
|
|
||||||
.uni-numbox-plus {
|
|
||||||
margin: 0;
|
|
||||||
width: 53rpx;
|
|
||||||
height: 53rpx;
|
|
||||||
background-color: #F84221;
|
|
||||||
opacity: 1;
|
|
||||||
line-height: 53rpx;
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 40upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-minus .yticon,
|
|
||||||
.uni-numbox-plus .yticon {
|
|
||||||
font-size: 36upx;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-minus {
|
|
||||||
/* border-right: none;
|
|
||||||
border-top-left-radius: 6upx;
|
|
||||||
border-bottom-left-radius: 6upx; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-plus {
|
|
||||||
/* border-left: none;
|
|
||||||
border-top-right-radius: 6upx;
|
|
||||||
border-bottom-right-radius: 6upx; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-value {
|
|
||||||
position: relative;
|
|
||||||
/* background-color: #f5f5f5; */
|
|
||||||
width: 90upx;
|
|
||||||
height: 50upx;
|
|
||||||
text-align: center;
|
|
||||||
padding: 0;
|
|
||||||
font-size: 30upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-numbox-disabled.yticon {
|
|
||||||
color: #d6d6d6;
|
|
||||||
}
|
|
||||||
</style>
|
|
BIN
components/tf-verify-img/img/tf-arrows.png
Normal file
BIN
components/tf-verify-img/img/tf-arrows.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 685 B |
BIN
components/tf-verify-img/img/tf-close.png
Normal file
BIN
components/tf-verify-img/img/tf-close.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 972 B |
249
components/tf-verify-img/tf-verify-img.vue
Normal file
249
components/tf-verify-img/tf-verify-img.vue
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
<template>
|
||||||
|
<view class="tf-Box-Bg">
|
||||||
|
<view class="tf-Box">
|
||||||
|
<view class="tf-Box-title">
|
||||||
|
请完成安全验证
|
||||||
|
<view class="tf-close" @click.stop="close_"></view>
|
||||||
|
</view>
|
||||||
|
<canvas :style="{ width: canvasW + 'px', height: canvasH + 'px' }"
|
||||||
|
class="tf-Box-center" canvas-id="tf-verify-canvas" id="tf-verify-canvas"></canvas>
|
||||||
|
<movable-area class="tf-Box-BtnBox">
|
||||||
|
<view class="tf-Box-BtnBox-text">滑动滑块完成拼图</view>
|
||||||
|
<movable-view class="tf-Box-BtnNei" direction="all" :x="canvasX2" @change="changePath" @touchend="endTouch">
|
||||||
|
<view class="tf-Box-BtnNei-leftBox" :style="{backgroundColor:verifyImgs[verifyIndex].color}"></view>
|
||||||
|
</movable-view>
|
||||||
|
</movable-area>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name:"tf-verify-img",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
verifyImgs:[{
|
||||||
|
src:'/static/verify/1.jpg',
|
||||||
|
color:'#38a7b7'
|
||||||
|
},{
|
||||||
|
src:'/static/verify/2.jpg',
|
||||||
|
color:'#485967'
|
||||||
|
},{
|
||||||
|
src:'/static/verify/3.jpg',
|
||||||
|
color:'#485967'
|
||||||
|
},{
|
||||||
|
src:'/static/verify/4.jpg',
|
||||||
|
color:'#485967'
|
||||||
|
},{
|
||||||
|
src:'/static/verify/5.jpg',
|
||||||
|
color:'#485967'
|
||||||
|
},{
|
||||||
|
src:'/static/verify/6.jpg',
|
||||||
|
color:'#485967'
|
||||||
|
}],
|
||||||
|
verifyIndex:0,
|
||||||
|
canvasW:"",
|
||||||
|
canvasH:"",
|
||||||
|
canvasX2:0,//归为用的
|
||||||
|
canvasX:0,//实时移动X
|
||||||
|
ctx:false,
|
||||||
|
jgX:0,//结果X
|
||||||
|
dqImgPath:'',//本地临时图片路径
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.canvasW = uni.upx2px(580);
|
||||||
|
this.canvasH = uni.upx2px(290);
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.init()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
// 生成从minNum到maxNum的随机数
|
||||||
|
randomNum(minNum,maxNum){
|
||||||
|
switch(arguments.length){
|
||||||
|
case 1:
|
||||||
|
return parseInt(Math.random()*minNum+1,10);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
close_(){
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
init(){
|
||||||
|
this.canvasX2--;
|
||||||
|
this.canvasX = 0;
|
||||||
|
this.verifyIndex = this.randomNum(0,this.verifyImgs.length-1);
|
||||||
|
this.ctx = uni.createCanvasContext('tf-verify-canvas',this);
|
||||||
|
this.jgX = this.randomNum(uni.upx2px(150),uni.upx2px(450));
|
||||||
|
this.dqImgPath = this.verifyImgs[this.verifyIndex].src;
|
||||||
|
this.huatu();
|
||||||
|
},
|
||||||
|
endTouch(){
|
||||||
|
if(Math.abs(this.canvasX-this.jgX)<=5){
|
||||||
|
this.$emit('succeed')
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: '验证失败',
|
||||||
|
icon:"error"
|
||||||
|
});
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
huatu(){
|
||||||
|
let this_ = this;
|
||||||
|
let r = uni.upx2px(10);
|
||||||
|
let XX = this.canvasX;
|
||||||
|
let YY = uni.upx2px(100);
|
||||||
|
let cs = uni.upx2px(20);
|
||||||
|
this_.ctx.drawImage(this_.dqImgPath,0,0,this_.canvasW,this_.canvasH);
|
||||||
|
|
||||||
|
//画不可移动的拼图块
|
||||||
|
this_.ctx.beginPath();
|
||||||
|
this_.ctx.moveTo(-2*r+this_.jgX+cs+2*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+5.5*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.arcTo(-2*r+this_.jgX+cs+5.5*r, YY-2*r+3*r, XX-2+this_.jgX*r+cs+6.5*r, YY-2*r+3*r, r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+7.5*r, YY-2*r+3*r);
|
||||||
|
this_.ctx.arcTo(-2*r+this_.jgX+cs+8.5*r, YY-2*r+3*r, -2*r+this_.jgX+cs+8.5*r, YY-2*r+2*r, r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+12*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+12*r, YY-2*r+11*r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+8.5*r, YY-2*r+11*r);
|
||||||
|
this_.ctx.arcTo(-2*r+this_.jgX+cs+8.5*r, YY-2*r+12*r, -2*r+this_.jgX+cs+7.5*r, YY-2*r+12*r, r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+6.5*r, YY-2*r+12*r);
|
||||||
|
this_.ctx.arcTo(-2*r+this_.jgX+cs+5.5*r, YY-2*r+12*r, -2*r+this_.jgX+cs+5.5*r, YY-2*r+11*r, r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+2*r, YY-2*r+11*r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+2*r, YY-2*r+8*r);
|
||||||
|
this_.ctx.arcTo(-2*r+this_.jgX+cs+3*r, YY-2*r+8*r, -2*r+this_.jgX+cs+3*r, YY-2*r+7*r, r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+3*r, YY-2*r+6*r);
|
||||||
|
this_.ctx.arcTo(-2*r+this_.jgX+cs+3*r, YY-2*r+5*r, -2*r+this_.jgX+cs+2*r, YY-2*r+5*r, r);
|
||||||
|
this_.ctx.lineTo(-2*r+this_.jgX+cs+2*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.shadowBlur=10;
|
||||||
|
this_.ctx.shadowColor="#ffffff";
|
||||||
|
this_.ctx.fillStyle = "rgba(0,0,0,0.5)";
|
||||||
|
this_.ctx.fill();
|
||||||
|
this_.ctx.restore();
|
||||||
|
//画可移动的拼图块
|
||||||
|
this_.ctx.beginPath();
|
||||||
|
this_.ctx.save();
|
||||||
|
this_.ctx.moveTo(XX-2*r+cs+2*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+5.5*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.arcTo(XX-2*r+cs+5.5*r, YY-2*r+3*r, XX-2*r+cs+6.5*r, YY-2*r+3*r, r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+7.5*r, YY-2*r+3*r);
|
||||||
|
this_.ctx.arcTo(XX-2*r+cs+8.5*r, YY-2*r+3*r, XX-2*r+cs+8.5*r, YY-2*r+2*r, r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+12*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+12*r, YY-2*r+11*r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+8.5*r, YY-2*r+11*r);
|
||||||
|
this_.ctx.arcTo(XX-2*r+cs+8.5*r, YY-2*r+12*r, XX-2*r+cs+7.5*r, YY-2*r+12*r, r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+6.5*r, YY-2*r+12*r);
|
||||||
|
this_.ctx.arcTo(XX-2*r+cs+5.5*r, YY-2*r+12*r, XX-2*r+cs+5.5*r, YY-2*r+11*r, r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+2*r, YY-2*r+11*r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+2*r, YY-2*r+8*r);
|
||||||
|
this_.ctx.arcTo(XX-2*r+cs+3*r, YY-2*r+8*r, XX-2*r+cs+3*r, YY-2*r+7*r, r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+3*r, YY-2*r+6*r);
|
||||||
|
this_.ctx.arcTo(XX-2*r+cs+3*r, YY-2*r+5*r, XX-2*r+cs+2*r, YY-2*r+5*r, r);
|
||||||
|
this_.ctx.lineTo(XX-2*r+cs+2*r, YY-2*r+2*r);
|
||||||
|
this_.ctx.shadowBlur=10;
|
||||||
|
this_.ctx.shadowColor="#ffffff";
|
||||||
|
this_.ctx.fill();
|
||||||
|
this_.ctx.clip();
|
||||||
|
this_.ctx.drawImage(this_.dqImgPath,this_.canvasX-this_.jgX,0,this_.canvasW,this_.canvasH);
|
||||||
|
this_.ctx.restore();
|
||||||
|
//绘图
|
||||||
|
this_.ctx.draw();
|
||||||
|
},
|
||||||
|
changePath(e){
|
||||||
|
this.canvasX = e.target.x;
|
||||||
|
this.huatu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
.tf-Box-Bg{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 100;
|
||||||
|
background-color: rgba(0,0,0,.3);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
.tf-Box{
|
||||||
|
width: 640upx;
|
||||||
|
height: 584upx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 6upx;
|
||||||
|
box-shadow: 0 0 50upx 0upx rgba(0,0,0,.2);
|
||||||
|
.tf-Box-title{
|
||||||
|
height: 100upx;
|
||||||
|
line-height: 1;
|
||||||
|
padding: 0 32upx;
|
||||||
|
font-size: 32upx;
|
||||||
|
border-bottom: 1px solid #E1E3E9;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
.tf-close{
|
||||||
|
width: 28upx;
|
||||||
|
height: 28upx;
|
||||||
|
background-image: url(img/tf-close.png);
|
||||||
|
background-size: 100% 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tf-Box-center{
|
||||||
|
margin: 30upx auto;
|
||||||
|
border-radius: 6upx;
|
||||||
|
}
|
||||||
|
.tf-Box-BtnBox{
|
||||||
|
margin: 30upx auto;
|
||||||
|
width: 580upx;
|
||||||
|
height: 75upx;
|
||||||
|
line-height: 75upx;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 28upx;
|
||||||
|
border-radius: 6upx;
|
||||||
|
border: 1px solid #E1E3E9;
|
||||||
|
background-color: #F7F8F9;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
.tf-Box-BtnBox-text{
|
||||||
|
width: 100%;
|
||||||
|
height: 75upx;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
color: #424649;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.tf-Box-BtnNei{
|
||||||
|
height: 75upx;
|
||||||
|
width: 75upx;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 0 10upx 0upx rgba(0,0,0,.2);
|
||||||
|
background-image: url(img/tf-arrows.png);
|
||||||
|
background-size: 34upx;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
.tf-Box-BtnNei-leftBox{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: -580upx;
|
||||||
|
width: 580upx;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,241 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="showPopup" class="uni-popup" @touchmove.stop.prevent="clear">
|
|
||||||
<uni-transition :mode-class="['fade']" :styles="maskClass" :show="showTrans" @click="onTap" />
|
|
||||||
<uni-transition :mode-class="ani" :styles="transClass" :show="showTrans" @click="onTap">
|
|
||||||
<view class="uni-popup__wrapper-box" @click.stop="clear">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</uni-transition>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
|
|
||||||
|
|
||||||
props: {
|
|
||||||
// 开启动画
|
|
||||||
animation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'center'
|
|
||||||
},
|
|
||||||
// maskClick
|
|
||||||
maskClick: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ani: [],
|
|
||||||
showPopup: false,
|
|
||||||
showTrans: false,
|
|
||||||
maskClass: {
|
|
||||||
'position': 'fixed',
|
|
||||||
'bottom': 0,
|
|
||||||
'top': 0,
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'backgroundColor': 'rgba(0, 0, 0, 0)'
|
|
||||||
},
|
|
||||||
transClass: {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
type: {
|
|
||||||
handler: function(newVal) {
|
|
||||||
switch (this.type) {
|
|
||||||
case 'top':
|
|
||||||
this.ani = ['slide-top']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'bottom':
|
|
||||||
this.ani = ['slide-bottom']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'bottom': 0
|
|
||||||
}
|
|
||||||
console.log('直播调用弹窗')
|
|
||||||
break
|
|
||||||
case 'center':
|
|
||||||
this.ani = ['zoom-out', 'fade']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
'display': 'flex',
|
|
||||||
'flexDirection': 'column',
|
|
||||||
/* #endif */
|
|
||||||
'bottom': 0,
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'top': 0,
|
|
||||||
'justifyContent': 'center',
|
|
||||||
'alignItems': 'center'
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
clear(e) {
|
|
||||||
// TODO nvue 取消冒泡
|
|
||||||
e.stopPropagation()
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.showPopup = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showTrans = true
|
|
||||||
}, 0);
|
|
||||||
})
|
|
||||||
this.$emit('change', {
|
|
||||||
show: true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
close(type) {
|
|
||||||
this.showTrans = false
|
|
||||||
this.$nextTick(() => {
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
this.$emit('change', {
|
|
||||||
show: false
|
|
||||||
})
|
|
||||||
this.showPopup = false
|
|
||||||
}, 0)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onTap() {
|
|
||||||
if (!this.maskClick) return
|
|
||||||
this.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
.uni-popup {
|
|
||||||
position: fixed;
|
|
||||||
/* #ifdef H5 */
|
|
||||||
top: var(--window-top);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef H5 */
|
|
||||||
top: 0;
|
|
||||||
/* #endif */
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__mask {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mask-ani {
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-top-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-bottom-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-center-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__wrapper {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(-500px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom {
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(500px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
/* #endif */
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
transform: scale(1.2);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__wrapper-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-ani {
|
|
||||||
/* transition: transform 0.3s;
|
|
||||||
*/
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.uni-top-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-bottom-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-center-content {
|
|
||||||
transform: scale(1);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,241 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view v-if="showPopup" class="uni-popup" @touchmove.stop.prevent="clear">
|
|
||||||
<uni-transition :mode-class="['fade']" :styles="maskClass" :show="showTrans" @click="onTap" />
|
|
||||||
<uni-transition :mode-class="ani" :styles="transClass" :show="showTrans" @click="onTap">
|
|
||||||
<view class="uni-popup__wrapper-box" @click.stop="clear">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</uni-transition>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
|
|
||||||
props: {
|
|
||||||
// 开启动画
|
|
||||||
animation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
// 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
default: 'center'
|
|
||||||
},
|
|
||||||
// maskClick
|
|
||||||
maskClick: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ani: [],
|
|
||||||
showPopup: false,
|
|
||||||
showTrans: false,
|
|
||||||
maskClass: {
|
|
||||||
'position': 'fixed',
|
|
||||||
'bottom': 0,
|
|
||||||
'top': 0,
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'backgroundColor': 'rgba(0, 0, 0, 0.4)'
|
|
||||||
},
|
|
||||||
transClass: {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
type: {
|
|
||||||
handler: function(newVal) {
|
|
||||||
switch (this.type) {
|
|
||||||
case 'top':
|
|
||||||
this.ani = ['slide-top']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case 'bottom':
|
|
||||||
this.ani = ['slide-bottom']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'bottom': 0
|
|
||||||
}
|
|
||||||
console.log('底部条用')
|
|
||||||
console.log(this.type)
|
|
||||||
break
|
|
||||||
case 'center':
|
|
||||||
this.ani = ['zoom-out', 'fade']
|
|
||||||
this.transClass = {
|
|
||||||
'position': 'fixed',
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
'display': 'flex',
|
|
||||||
'flexDirection': 'column',
|
|
||||||
/* #endif */
|
|
||||||
'bottom': 0,
|
|
||||||
'left': 0,
|
|
||||||
'right': 0,
|
|
||||||
'top': 0,
|
|
||||||
'justifyContent': 'center',
|
|
||||||
'alignItems': 'center'
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
|
||||||
}
|
|
||||||
},
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
clear(e) {
|
|
||||||
// TODO nvue 取消冒泡
|
|
||||||
e.stopPropagation()
|
|
||||||
},
|
|
||||||
open() {
|
|
||||||
this.showPopup = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.showTrans = true
|
|
||||||
}, 50);
|
|
||||||
})
|
|
||||||
this.$emit('change', {
|
|
||||||
show: true
|
|
||||||
})
|
|
||||||
},
|
|
||||||
close(type) {
|
|
||||||
this.showTrans = false
|
|
||||||
this.$nextTick(() => {
|
|
||||||
clearTimeout(this.timer)
|
|
||||||
this.timer = setTimeout(() => {
|
|
||||||
this.$emit('change', {
|
|
||||||
show: false
|
|
||||||
})
|
|
||||||
this.showPopup = false
|
|
||||||
}, 300)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onTap() {
|
|
||||||
if (!this.maskClick) return
|
|
||||||
this.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
.uni-popup {
|
|
||||||
position: fixed;
|
|
||||||
/* #ifdef H5 */
|
|
||||||
top: var(--window-top);
|
|
||||||
/* #endif */
|
|
||||||
/* #ifndef H5 */
|
|
||||||
top: 0;
|
|
||||||
/* #endif */
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
z-index: 99;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__mask {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mask-ani {
|
|
||||||
transition-property: opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-top-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-bottom-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-center-mask {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__wrapper {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top {
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(-500px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bottom {
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
transform: translateY(500px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
/* #endif */
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
transform: scale(1.2);
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-popup__wrapper-box {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: block;
|
|
||||||
/* #endif */
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content-ani {
|
|
||||||
/* transition: transform 0.3s;
|
|
||||||
*/
|
|
||||||
transition-property: transform, opacity;
|
|
||||||
transition-duration: 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.uni-top-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-bottom-content {
|
|
||||||
transform: translateY(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.uni-center-content {
|
|
||||||
transform: scale(1);
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,261 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view :style="viewColor">
|
|
||||||
<view class="address-window" :class="display==true?'on':''">
|
|
||||||
<view class='title'>请选择所在村队<text class='iconfont icon-guanbi' @tap='close'></text></view>
|
|
||||||
<view class="address-count">
|
|
||||||
<view class="address-selected">
|
|
||||||
<view v-for="(item,index) in selectedArr" :key="index" class="selected-list" :class="{active:index === selectedIndex}" @click="change(item.parent_id, index)">
|
|
||||||
{{item.name}}
|
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
|
||||||
</view>
|
|
||||||
<view class="selected-list" :class="{active:-1 === selectedIndex}" v-if="showMore" @click="change(-1, -1)">
|
|
||||||
<text class="iconfont icon-xiangyou"></text>
|
|
||||||
请选择
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<scroll-view scroll-y="true" :scroll-top="scrollTop" class="address-list" @scroll="scroll">
|
|
||||||
<view v-for="(item,index) in addressList" :key="index" class="list" :class="{active:item.id === activeId}" @click="selected(item)">
|
|
||||||
<text class="item-name">{{item.name}}</text>
|
|
||||||
<text v-if="item.id === activeId" class="iconfont icon-duihao2"></text>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class='mask' catchtouchmove="true" :hidden='display==false' @tap='close'></view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: CRMEB Team <admin@crmeb.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
import {getAddressList} from '@/api/user.js';
|
|
||||||
import {brigade } from '@/api/api.js';
|
|
||||||
import { mapGetters } from "vuex";
|
|
||||||
const CACHE_ADDRESS = {};
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
display: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
address: Array,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
active: 0,
|
|
||||||
//地址列表
|
|
||||||
addressList: [],
|
|
||||||
selectedArr: [],
|
|
||||||
selectedIndex: -1,
|
|
||||||
is_loading: false,
|
|
||||||
old: { scrollTop: 0 },
|
|
||||||
scrollTop: 0
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed:{
|
|
||||||
...mapGetters(['viewColor']),
|
|
||||||
activeId(){
|
|
||||||
return this.selectedIndex == -1 ? 0 : this.selectedArr[this.selectedIndex].id
|
|
||||||
},
|
|
||||||
showMore(){
|
|
||||||
return this.selectedArr.length ? this.selectedArr[this.selectedArr.length - 1].snum > 0 : true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch:{
|
|
||||||
address(n){
|
|
||||||
this.selectedArr = n ? [...n] : []
|
|
||||||
},
|
|
||||||
display(n){
|
|
||||||
if(!n) {
|
|
||||||
this.addressList = [];
|
|
||||||
this.selectedArr = this.address ? [...this.address] : [];
|
|
||||||
this.selectedIndex = -1;
|
|
||||||
this.is_loading = false;
|
|
||||||
}else{
|
|
||||||
this.loadAddress()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loadAddress()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
change(pid,index){
|
|
||||||
if(this.selectedIndex == index) return;
|
|
||||||
if(pid === -1){
|
|
||||||
pid = this.selectedArr.length ? this.selectedArr[this.selectedArr.length -1].id : 0;
|
|
||||||
}
|
|
||||||
console.log(index)
|
|
||||||
this.selectedIndex = index;
|
|
||||||
this.loadAddress();
|
|
||||||
},
|
|
||||||
loadAddress(pid){
|
|
||||||
if(CACHE_ADDRESS[pid]){
|
|
||||||
this.addressList = CACHE_ADDRESS[pid];
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
this.is_loading = true;
|
|
||||||
brigade(pid).then(res=>{
|
|
||||||
console.log(res.data)
|
|
||||||
this.is_loading = false;
|
|
||||||
CACHE_ADDRESS[pid] = res.data;
|
|
||||||
this.addressList = res.data;
|
|
||||||
})
|
|
||||||
this.goTop()
|
|
||||||
},
|
|
||||||
selected(item){
|
|
||||||
if(this.is_loading) return;
|
|
||||||
if(this.selectedIndex > -1){
|
|
||||||
this.selectedArr.splice(this.selectedIndex + 1,999)
|
|
||||||
this.selectedArr[this.selectedIndex] = item;
|
|
||||||
this.selectedIndex = -1;
|
|
||||||
}else if(!item.parent_id){
|
|
||||||
this.selectedArr = [item];
|
|
||||||
}else{
|
|
||||||
this.selectedArr.push(item);
|
|
||||||
}
|
|
||||||
if(item.snum){
|
|
||||||
this.loadAddress(item.id);
|
|
||||||
} else {
|
|
||||||
this.$emit('submit', [...this.selectedArr]);
|
|
||||||
this.$emit('changeClose');
|
|
||||||
}
|
|
||||||
this.goTop()
|
|
||||||
},
|
|
||||||
close: function() {
|
|
||||||
this.$emit('changeClose');
|
|
||||||
},
|
|
||||||
scroll : function(e) {
|
|
||||||
this.old.scrollTop = e.detail.scrollTop
|
|
||||||
},
|
|
||||||
goTop: function(e) {
|
|
||||||
this.scrollTop = this.old.scrollTop
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.scrollTop = 0
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.address-window {
|
|
||||||
background-color: #fff;
|
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
z-index: 101;
|
|
||||||
border-radius: 30rpx 30rpx 0 0;
|
|
||||||
transform: translate3d(0, 100%, 0);
|
|
||||||
transition: all .3s cubic-bezier(.25, .5, .5, .9);
|
|
||||||
}
|
|
||||||
.address-window.on {
|
|
||||||
transform: translate3d(0, 0, 0);
|
|
||||||
}
|
|
||||||
.address-window .title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
height: 123rpx;
|
|
||||||
line-height: 123rpx;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.address-window .title .iconfont {
|
|
||||||
position: absolute;
|
|
||||||
right: 30rpx;
|
|
||||||
color: #8a8a8a;
|
|
||||||
font-size: 35rpx;
|
|
||||||
}
|
|
||||||
.address-count{
|
|
||||||
.address-selected{
|
|
||||||
padding: 0 30rpx;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
position: relative;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
border-bottom: 2rpx solid #f7f7f7;
|
|
||||||
}
|
|
||||||
.selected-list{
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #282828;
|
|
||||||
line-height: 50rpx;
|
|
||||||
padding-bottom: 10rpx;
|
|
||||||
padding-left: 60rpx;
|
|
||||||
position: relative;
|
|
||||||
&.active{
|
|
||||||
color: #e28d54;
|
|
||||||
}
|
|
||||||
&:before,&:after{
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
&:before{
|
|
||||||
width: 4rpx;
|
|
||||||
height: 100%;
|
|
||||||
background-color: var(--view-theme);
|
|
||||||
top: 0;
|
|
||||||
left: 10rpx;
|
|
||||||
}
|
|
||||||
&:after{
|
|
||||||
width: 12rpx;
|
|
||||||
height: 12rpx;
|
|
||||||
background: var(--view-theme);
|
|
||||||
border-radius: 100%;
|
|
||||||
left: 6rpx;
|
|
||||||
top: 50%;
|
|
||||||
margin-top: -8rpx;
|
|
||||||
}
|
|
||||||
&:first-child,&:last-child{
|
|
||||||
&:before{
|
|
||||||
height: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:first-child{
|
|
||||||
&:before{
|
|
||||||
top: auto;
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.iconfont{
|
|
||||||
font-size: 20rpx;
|
|
||||||
float: right;
|
|
||||||
color: #dddddd;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
scroll-view{
|
|
||||||
height: 550rpx;
|
|
||||||
}
|
|
||||||
.address-list{
|
|
||||||
padding: 0 30rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
box-sizing: border-box;
|
|
||||||
.list{
|
|
||||||
.iconfont{
|
|
||||||
float: right;
|
|
||||||
color: #ddd;
|
|
||||||
font-size: 22rpx;
|
|
||||||
}
|
|
||||||
.item-name{
|
|
||||||
display: inline-block;
|
|
||||||
line-height: 50rpx;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
&.active{
|
|
||||||
color: #e28d54;
|
|
||||||
.iconfont{
|
|
||||||
color: #e28d54;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -4,23 +4,20 @@
|
|||||||
<view class="bg-img">
|
<view class="bg-img">
|
||||||
<img :src="bgColor" alt="">
|
<img :src="bgColor" alt="">
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="site-box flex_a_c_j_sb">
|
<view class="site-box flex_a_c_j_sb">
|
||||||
|
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
||||||
<!-- <view class="place_wrapper flex_a_c" @click="selectLocation">
|
|
||||||
<view class="iconfont icon-weizhi"></view>
|
<view class="iconfont icon-weizhi"></view>
|
||||||
<view class="town_name">{{street}}</view>
|
<view class="town_name">{{street}}</view>
|
||||||
</view>
|
</view>
|
||||||
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
||||||
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
|
<view class="iconfont icon-xiaoxi" style="color:#fff;"></view>
|
||||||
</navigator> -->
|
</navigator>
|
||||||
</view>
|
</view>
|
||||||
<!-- 搜索栏 -->
|
<!-- 搜索栏 -->
|
||||||
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none" class="search_content flex_a_c_j_sb">
|
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none" class="search_content flex_a_c_j_sb">
|
||||||
<view class="flex_a_c">
|
<view class="flex_a_c">
|
||||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
<view class="iconfont icon-sousuo"></view>
|
||||||
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" placeholder-style="font-size: 30rpx;"
|
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" disabled>
|
||||||
disabled>
|
|
||||||
</view>
|
</view>
|
||||||
<button class="search_btn">搜索</button>
|
<button class="search_btn">搜索</button>
|
||||||
</navigator>
|
</navigator>
|
||||||
@ -31,33 +28,23 @@
|
|||||||
indicator-active-color="#fff">
|
indicator-active-color="#fff">
|
||||||
<block v-for="(item,index) in swiper['url']" :key="index">
|
<block v-for="(item,index) in swiper['url']" :key="index">
|
||||||
<swiper-item class="swi_item" @click="swiperClick(item)">
|
<swiper-item class="swi_item" @click="swiperClick(item)">
|
||||||
<u--image :showLoading="true" :src="item.img" width="724rpx" height="259rpx" mode="aspectFit">
|
<u--image :showLoading="true" :src="item.img" width="694.74rpx" height="242.11rpx" mode="aspectFill">
|
||||||
</u--image>
|
</u--image>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</block>
|
</block>
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
<!-- <u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
<u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
||||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker> -->
|
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import { getArea, getStreet } from '@/api/article.js';
|
||||||
getArea,
|
import { getIndexData, getDiy } from '@/api/api.js'
|
||||||
getStreet
|
import { getGeocoder } from '@/api/store.js';
|
||||||
} from '@/api/article.js';
|
import { mapGetters } from 'vuex'
|
||||||
import {
|
import { Toast } from '../libs/uniApi';
|
||||||
getIndexData,
|
|
||||||
getDiy
|
|
||||||
} from '@/api/api.js'
|
|
||||||
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from 'vuex'
|
|
||||||
import {
|
|
||||||
Toast
|
|
||||||
} from '../libs/uniApi';
|
|
||||||
import Cache from '@/utils/cache';
|
import Cache from '@/utils/cache';
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
@ -65,21 +52,15 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
// location_Arr: {
|
location_Arr: {
|
||||||
// type: Object,
|
type: Object,
|
||||||
// default: () => ({})
|
default: () => ({})
|
||||||
// },
|
}
|
||||||
// town: {
|
|
||||||
// type: String,
|
|
||||||
// default: false
|
|
||||||
// },
|
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
defaInd: [0, 0],
|
defaInd: [0, 0],
|
||||||
street: '',
|
street: '',
|
||||||
|
|
||||||
showPicker: false,
|
showPicker: false,
|
||||||
styleConfig: [],
|
styleConfig: [],
|
||||||
columnData: [],
|
columnData: [],
|
||||||
@ -96,29 +77,21 @@
|
|||||||
interval: 2000, // 自动切换时间间隔
|
interval: 2000, // 自动切换时间间隔
|
||||||
duration: 400 // 滑动动画时长
|
duration: 400 // 滑动动画时长
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: mapGetters(['location']),
|
||||||
watch: {
|
watch: {
|
||||||
street(nval, val) {
|
location: {
|
||||||
this.street = nval
|
handler(newVal, oldVal) {
|
||||||
|
if (newVal.address_component?.street) this.street = newVal.address_component.street
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
|
|
||||||
this.getBanner()
|
this.getBanner()
|
||||||
// this.Area()
|
this.Area()
|
||||||
|
if (this.location.address_component?.street) this.street = this.location.address_component.street
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
|
|
||||||
this.$bus.$on('value-updated', (newValue) => {
|
|
||||||
// 更新组件的值
|
|
||||||
this.street = newValue.split(',')[0]
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
swiperClick(item) {
|
swiperClick(item) {
|
||||||
@ -130,19 +103,12 @@
|
|||||||
selectLocation() {
|
selectLocation() {
|
||||||
this.isSelectPlace ? this.showPicker = true : ''
|
this.isSelectPlace ? this.showPicker = true : ''
|
||||||
},
|
},
|
||||||
|
|
||||||
confirm(e) {
|
confirm(e) {
|
||||||
|
this.street = e.value[1].name
|
||||||
this.showPicker = false
|
this.showPicker = false
|
||||||
this.$emit('selectPlce', e)
|
this.$emit('selectPlce', e)
|
||||||
this.$emit('change', e)
|
let adress = Cache.get('LOCATION_DATA',true)
|
||||||
this.street = e.value[1].name
|
Cache.set('LOCATION_DATA',adress)
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
changeHandler(e) {
|
changeHandler(e) {
|
||||||
const {
|
const {
|
||||||
@ -153,41 +119,29 @@
|
|||||||
picker = this.$refs.uPicker
|
picker = this.$refs.uPicker
|
||||||
} = e;
|
} = e;
|
||||||
if (columnIndex === 0) {
|
if (columnIndex === 0) {
|
||||||
getStreet({
|
getStreet({ area_code: value[0]['code'] }).then(res => {
|
||||||
area_code: value[0]['code']
|
|
||||||
}).then(res => {
|
|
||||||
picker.setColumnValues(1, res.data);
|
picker.setColumnValues(1, res.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Area() {
|
Area() {
|
||||||
getArea({
|
getArea({ city_code: 510500 }).then(res => {
|
||||||
city_code: 510500
|
|
||||||
}).then(res => {
|
|
||||||
this.$refs.uPicker.setColumnValues(0, res.data);
|
this.$refs.uPicker.setColumnValues(0, res.data);
|
||||||
this.Street(res.data[0]['code']);
|
this.Street(res.data[0]['code']);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
Street(code) {
|
Street(code) {
|
||||||
getStreet({
|
getStreet({ area_code: code }).then(res => {
|
||||||
area_code: code
|
|
||||||
}).then(res => {
|
|
||||||
this.$refs.uPicker.setColumnValues(1, res.data);
|
this.$refs.uPicker.setColumnValues(1, res.data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
swiperChange(e) {
|
swiperChange(e) {
|
||||||
let {
|
let { current, source } = e.detail;
|
||||||
current,
|
|
||||||
source
|
|
||||||
} = e.detail;
|
|
||||||
if (source === 'autoplay' || source === 'touch') {
|
if (source === 'autoplay' || source === 'touch') {
|
||||||
this.bgColor = this.swiper.url[e.detail.current]['img']
|
this.bgColor = this.swiper.url[e.detail.current]['img']
|
||||||
this.$emit('kkchange', this.bgColor)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 对象转数组
|
// 对象转数组
|
||||||
objToArr(data) {
|
objToArr(data) {
|
||||||
let obj = Object.keys(data).sort();
|
let obj = Object.keys(data).sort();
|
||||||
@ -196,11 +150,7 @@
|
|||||||
},
|
},
|
||||||
async getBanner(id) {
|
async getBanner(id) {
|
||||||
let that = this;
|
let that = this;
|
||||||
const {
|
const { data } = await getDiy({ id: 0 })
|
||||||
data
|
|
||||||
} = await getDiy({
|
|
||||||
id: 0
|
|
||||||
})
|
|
||||||
that.styleConfig = that.objToArr(data.value);
|
that.styleConfig = that.objToArr(data.value);
|
||||||
/* 循环数组得到数据*/
|
/* 循环数组得到数据*/
|
||||||
that.styleConfig.forEach((item, index, arr) => {
|
that.styleConfig.forEach((item, index, arr) => {
|
||||||
@ -216,7 +166,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
.zbp-head-wrapper {
|
.zbp-head-wrapper {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-top: 78.95rpx;
|
padding-top: 78.95rpx;
|
||||||
@ -231,7 +181,7 @@
|
|||||||
width: 102%;
|
width: 102%;
|
||||||
height: 133px;
|
height: 133px;
|
||||||
border-radius: 30px 30px 0 0;
|
border-radius: 30px 30px 0 0;
|
||||||
background-color: #f8f8f8;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg-img {
|
.bg-img {
|
||||||
@ -263,17 +213,15 @@
|
|||||||
height: 66.67rpx;
|
height: 66.67rpx;
|
||||||
margin-bottom: 26.32rpx;
|
margin-bottom: 26.32rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
|
||||||
|
|
||||||
|
|
||||||
// 位置
|
// 位置
|
||||||
.place_wrapper {
|
.place_wrapper {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin-right: 24.56rpx;
|
margin-right: 24.56rpx;
|
||||||
font-size: 30rpx;
|
font-size: 31.58rpx;
|
||||||
|
|
||||||
.town_name {
|
.town_name {
|
||||||
margin-left: 21rpx;
|
margin-left: 10.53rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,12 +236,12 @@
|
|||||||
|
|
||||||
.search_content {
|
.search_content {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 724rpx;
|
width: 694.74rpx;
|
||||||
height: 64rpx;
|
height: 61.4rpx;
|
||||||
padding: 2px 2px 2px 21.05rpx;
|
padding: 2px 2px 2px 21.05rpx;
|
||||||
border-radius: 175rpx;
|
border-radius: 100px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
margin-bottom: 21rpx;
|
margin-bottom: 17.54rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
@ -307,8 +255,8 @@
|
|||||||
.search_btn {
|
.search_btn {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
width: 105.26rpx;
|
width: 105.26rpx;
|
||||||
height: 56rpx;
|
height: 52.63rpx;
|
||||||
line-height: 56rpx;
|
line-height: 52.63rpx;
|
||||||
background: #f84221;
|
background: #f84221;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
font-size: 28.07rpx;
|
font-size: 28.07rpx;
|
||||||
@ -321,15 +269,15 @@
|
|||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
.swiper {
|
.swiper {
|
||||||
width: 724rpx;
|
width: 694.74rpx;
|
||||||
height: 259rpx;
|
height: 242.11rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
border-radius: 20rpx 20rpx 20rpx 20rpx;
|
border-radius: 15px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.swi_item {
|
.swi_item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 259rpx;
|
height: 242.11rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,353 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="zbp-head-wrapper">
|
|
||||||
<view class="color-lump"></view>
|
|
||||||
<view class="bg-img">
|
|
||||||
<img :src="bgColor" alt="">
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="site-box flex_a_c_j_sb" style="padding-top: var(--status-bar-height)">
|
|
||||||
|
|
||||||
<view class="place_wrapper flex_a_c" @click="selectLocation">
|
|
||||||
<view class="iconfont icon-weizhi"></view>
|
|
||||||
<view class="town_name">{{street}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="" style="display: flex;">
|
|
||||||
<navigator url="/pages/chat/customer_list/index?type=0" hover-class="none">
|
|
||||||
<view class="iconfont icon-xiaoxi" style="color:#fff;margin-right: 20rpx;"></view>
|
|
||||||
</navigator>
|
|
||||||
<navigator url="/pages/columnGoods/goods_search/index" hover-class="none">
|
|
||||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;color: white;"></view>
|
|
||||||
</navigator>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
<!-- 搜索栏 -->
|
|
||||||
<!-- <navigator url="/pages/columnGoods/goods_search/index" hover-class="none" class="search_content flex_a_c_j_sb">
|
|
||||||
<view class="flex_a_c">
|
|
||||||
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
|
|
||||||
<input type="text" v-model="keyword" placeholder="搜索产品或店铺" placeholder-style="font-size: 30rpx;"
|
|
||||||
disabled>
|
|
||||||
</view>
|
|
||||||
<button class="search_btn">搜索</button>
|
|
||||||
</navigator> -->
|
|
||||||
<!-- 轮播图 -->
|
|
||||||
<view class="supply_chains-head">
|
|
||||||
<swiper class="swiper " @change="swiperChange" :indicator-dots="swiper.indicatorDots"
|
|
||||||
:autoplay="swiper.autoplay" :interval="swiper.interval" :duration="swiper.duration"
|
|
||||||
indicator-active-color="#fff">
|
|
||||||
<block v-for="(item,index) in swiper['url']" :key="index">
|
|
||||||
<swiper-item class="swi_item" @click="swiperClick(item)">
|
|
||||||
<!-- <u--image :showLoading="true" :src="item.img" width="750rpx" height="259rpx" mode="aspectFit">
|
|
||||||
</u--image> -->
|
|
||||||
<u--image :showLoading="true" :src="item.img" width="750rpx" height="600rpx">
|
|
||||||
</u--image>
|
|
||||||
</swiper-item>
|
|
||||||
</block>
|
|
||||||
</swiper>
|
|
||||||
</view>
|
|
||||||
<u-picker :defaultIndex="defaInd" :show="showPicker" ref="uPicker" :columns="columnData" @confirm="confirm"
|
|
||||||
@cancel="showPicker = false" @change="changeHandler" keyName="name"></u-picker>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
getArea,
|
|
||||||
getStreet
|
|
||||||
} from '@/api/article.js';
|
|
||||||
import {
|
|
||||||
getIndexData,
|
|
||||||
getDiy
|
|
||||||
} from '@/api/api.js'
|
|
||||||
import {
|
|
||||||
getGeocoder
|
|
||||||
} from '@/api/store.js';
|
|
||||||
import {
|
|
||||||
mapGetters
|
|
||||||
} from 'vuex'
|
|
||||||
import {
|
|
||||||
Toast
|
|
||||||
} from '../libs/uniApi';
|
|
||||||
import Cache from '@/utils/cache';
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
isSelectPlace: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
location_Arr: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({})
|
|
||||||
},
|
|
||||||
town: {
|
|
||||||
type: String,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
defaInd: [0, 0],
|
|
||||||
street: '',
|
|
||||||
|
|
||||||
showPicker: false,
|
|
||||||
styleConfig: [],
|
|
||||||
columnData: [],
|
|
||||||
homeCombData: [],
|
|
||||||
keyword: '',
|
|
||||||
bgColor: '',
|
|
||||||
swiper: {
|
|
||||||
url: [{
|
|
||||||
img: ''
|
|
||||||
}],
|
|
||||||
indicatorDots: true, // 显示面板指示点
|
|
||||||
vertical: false, // 滑动方向是否为纵向
|
|
||||||
autoplay: true, // 是否自动切换
|
|
||||||
interval: 2000, // 自动切换时间间隔
|
|
||||||
duration: 400 // 滑动动画时长
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
street(nval, val) {
|
|
||||||
this.street = nval
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
created() {
|
|
||||||
|
|
||||||
this.getBanner()
|
|
||||||
this.Area()
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.$bus.$on('value-updated', (newValue) => {
|
|
||||||
// 更新组件的值
|
|
||||||
this.street = newValue.split(',')[0]
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
swiperClick(item) {
|
|
||||||
const url = item.info[1].value
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
selectLocation() {
|
|
||||||
this.isSelectPlace ? this.showPicker = true : ''
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm(e) {
|
|
||||||
|
|
||||||
this.showPicker = false
|
|
||||||
this.$emit('selectPlce', e)
|
|
||||||
this.$emit('change', e)
|
|
||||||
this.street = e.value[1].name
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$bus.$emit('value-updated', e.value[1].name + ',' + e.value[1].code);
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
changeHandler(e) {
|
|
||||||
const {
|
|
||||||
columnIndex,
|
|
||||||
value,
|
|
||||||
values,
|
|
||||||
index,
|
|
||||||
picker = this.$refs.uPicker
|
|
||||||
} = e;
|
|
||||||
if (columnIndex === 0) {
|
|
||||||
getStreet({
|
|
||||||
area_code: value[0]['code']
|
|
||||||
}).then(res => {
|
|
||||||
picker.setColumnValues(1, res.data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Area() {
|
|
||||||
getArea({
|
|
||||||
city_code: 510500
|
|
||||||
}).then(res => {
|
|
||||||
this.$refs.uPicker.setColumnValues(0, res.data);
|
|
||||||
this.Street(res.data[0]['code']);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
Street(code) {
|
|
||||||
getStreet({
|
|
||||||
area_code: code
|
|
||||||
}).then(res => {
|
|
||||||
this.$refs.uPicker.setColumnValues(1, res.data);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
swiperChange(e) {
|
|
||||||
let {
|
|
||||||
current,
|
|
||||||
source
|
|
||||||
} = e.detail;
|
|
||||||
if (source === 'autoplay' || source === 'touch') {
|
|
||||||
this.bgColor = this.swiper.url[e.detail.current]['img']
|
|
||||||
this.$emit('kkchange', this.bgColor)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
// 对象转数组
|
|
||||||
objToArr(data) {
|
|
||||||
let obj = Object.keys(data).sort();
|
|
||||||
let m = obj.map(key => data[key]);
|
|
||||||
return m;
|
|
||||||
},
|
|
||||||
async getBanner(id) {
|
|
||||||
let that = this;
|
|
||||||
const {
|
|
||||||
data
|
|
||||||
} = await getDiy({
|
|
||||||
id: 0
|
|
||||||
})
|
|
||||||
that.styleConfig = that.objToArr(data.value);
|
|
||||||
/* 循环数组得到数据*/
|
|
||||||
that.styleConfig.forEach((item, index, arr) => {
|
|
||||||
if (item.name == 'headerSerch' || item.name == 'homeComb') {
|
|
||||||
if (item.name == 'homeComb') {
|
|
||||||
that.swiper.url = item.swiperConfig.list
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.bgColor = this.swiper.url[0].img
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.zbp-head-wrapper {
|
|
||||||
position: relative;
|
|
||||||
// padding-top: 78.95rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
// background-color: green;
|
|
||||||
height: 600rpx;
|
|
||||||
|
|
||||||
// .color-lump {
|
|
||||||
// z-index: 1;
|
|
||||||
// position: absolute;
|
|
||||||
// bottom: -86px;
|
|
||||||
// left: 50%;
|
|
||||||
// transform: translate(-50%, 0);
|
|
||||||
// width: 102%;
|
|
||||||
// height: 133px;
|
|
||||||
// border-radius: 30px 30px 0 0;
|
|
||||||
// background-color: #fff;
|
|
||||||
// }
|
|
||||||
|
|
||||||
.bg-img {
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
/* #ifdef MP || APP-PLUS */
|
|
||||||
z-index: -1;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifdef H5 */
|
|
||||||
z-index: 0;
|
|
||||||
/* #endif */
|
|
||||||
z-index: 0;
|
|
||||||
filter: blur(0);
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
filter: blur(30rpx);
|
|
||||||
transform: scale(1.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-box {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 750rpx;
|
|
||||||
height: 66.67rpx;
|
|
||||||
margin-top: 30rpx;
|
|
||||||
// margin-bottom: 26.32rpx;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 9999;
|
|
||||||
padding-right: 20rpx;
|
|
||||||
|
|
||||||
|
|
||||||
// 位置
|
|
||||||
.place_wrapper {
|
|
||||||
margin-left: 20rpx;
|
|
||||||
color: #fff;
|
|
||||||
margin-right: 24.56rpx;
|
|
||||||
font-size: 30rpx;
|
|
||||||
|
|
||||||
.town_name {
|
|
||||||
margin-left: 21rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
font-size: 35.09rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.my-main {
|
|
||||||
transition: background-color .5s ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search_content {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 724rpx;
|
|
||||||
height: 74rpx;
|
|
||||||
padding: 2px 2px 2px 21.05rpx;
|
|
||||||
border-radius: 175rpx;
|
|
||||||
background: #fff;
|
|
||||||
margin-bottom: 21rpx;
|
|
||||||
position: relative;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.icon-sousuo {
|
|
||||||
font-size: 26.32rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #c8c7c6;
|
|
||||||
margin-right: 17.54rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search_btn {
|
|
||||||
color: #fff;
|
|
||||||
width: 105.26rpx;
|
|
||||||
height: 52.63rpx;
|
|
||||||
line-height: 52.63rpx;
|
|
||||||
background: #f84221;
|
|
||||||
border-radius: 100px;
|
|
||||||
font-size: 28.07rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.supply_chains-head {
|
|
||||||
// margin-bottom: 17.54rpx;
|
|
||||||
position: relative;
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
.swiper {
|
|
||||||
width: 750rpx;
|
|
||||||
height: 600rpx;
|
|
||||||
margin: 0 auto;
|
|
||||||
// border-radius: 20rpx 20rpx 20rpx 20rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.swi_item {
|
|
||||||
width: 750rpx;
|
|
||||||
height: 600rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -6,49 +6,31 @@ let openPlantGrass = '-openPlantGrass-'
|
|||||||
let httpApi
|
let httpApi
|
||||||
let httpApiTwo
|
let httpApiTwo
|
||||||
let httpApiThree
|
let httpApiThree
|
||||||
let httpApiFour
|
// 网络接口修改此字符 小程序域名要求https
|
||||||
let httpApiFive
|
// let httpApi = 'http://192.168.31.110:8324' // 测试
|
||||||
let httpApiSix
|
if (process.env.NODE_ENV === "development") {
|
||||||
let wsApi
|
httpApi = "https://crmeb-test.shop.lihaink.cn"
|
||||||
|
// httpApi = "http://192.168.0.222"
|
||||||
// 在打包之前请检查当前环境是否正确
|
// #ifdef MP-WEIXIN
|
||||||
const env = 'dev'; // 开发
|
httpApiTwo = "http://cms.com"
|
||||||
// const env = 'prod'; // 生产
|
httpApiThree = 'http://ceshi-oa.lihaink.cn'
|
||||||
// const env = 'prew'; // 预上线
|
// #endif
|
||||||
|
// #ifdef H5
|
||||||
switch (env) {
|
// httpApiTwo = "baseUrl" // h5跨域配置
|
||||||
case 'prod':
|
httpApiTwo = "https://nk.lihaink.cn" // h5跨域配置
|
||||||
|
// httpApiThree = 'baseUrlTest' // h5跨域配置
|
||||||
|
// #endif
|
||||||
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
httpApi = 'https://shop.lihaink.cn' // 生产
|
httpApi = 'https://shop.lihaink.cn' // 生产
|
||||||
httpApiTwo = 'https://nk.lihaink.cn'
|
httpApiTwo = 'https://nk.lihaink.cn' // 生产
|
||||||
httpApiThree = 'http://ceshi-oa.lihaink.cn'
|
httpApiThree = 'http://ceshi-oa.lihaink.cn' //生产
|
||||||
httpApiFour = 'https://worker-task.lihaink.cn'
|
|
||||||
httpApiSix = 'https://new-worker.lihaink.cn'
|
|
||||||
wsApi = 'wss://shop.lihaink.cn'
|
|
||||||
break;
|
|
||||||
case 'prew':
|
|
||||||
httpApi = 'https://test.shop.lihaink.cn' //预发布环境
|
|
||||||
httpApiTwo = "https://nk.lihaink.cn"
|
|
||||||
httpApiThree = 'http://ceshi-oa.lihaink.cn'
|
|
||||||
httpApiFour = 'https://preview-worker-task.lihaink.cn'
|
|
||||||
httpApiSix = 'https://ceshi-new-wokr.lihaink.cn'
|
|
||||||
wsApi = 'wss://test.shop.lihaink.cn'
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
httpApi = "https://crmeb-test.shop.lihaink.cn" // 测试
|
|
||||||
httpApiTwo = "https://nk.lihaink.cn"
|
|
||||||
httpApiThree = 'http://ceshi-oa.lihaink.cn'
|
|
||||||
httpApiFour = 'https://ceshi-worker-task.lihaink.cn'
|
|
||||||
httpApiFive = 'https://ceshi-zhibo.lihaink.cn'
|
|
||||||
httpApiSix = 'https://ceshi-new-wokr.lihaink.cn'
|
|
||||||
wsApi = 'wss://crmeb-test.shop.lihaink.cn'
|
|
||||||
}
|
}
|
||||||
|
// httpApi = 'https://shop.lihaink.cn' // 生产
|
||||||
const ossUrl = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public'
|
// httpApiTwo = 'https://nk.lihaink.cn' // 生产
|
||||||
// httpApi=''
|
|
||||||
|
|
||||||
// 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
|
// 聊天接口修改此字符 小程序聊天要求wss 例如:wss://mer.crmeb.net
|
||||||
// wsApi = 'ws://192.168.1.17:8324'
|
// let wsApi = 'ws://192.168.3.20:8324'
|
||||||
let wsApi_one = 'wss://ceshi-zhibo.lihaink.cn/chat_room'
|
let wsApi = 'wss://shop.lihaink.cn'
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// 请求域名 格式: https://您的域名
|
// 请求域名 格式: https://您的域名
|
||||||
@ -57,28 +39,17 @@ module.exports = {
|
|||||||
HTTP_REQUEST_URL: httpApi,
|
HTTP_REQUEST_URL: httpApi,
|
||||||
HTTP_REQUEST_URL_TWO: httpApiTwo,
|
HTTP_REQUEST_URL_TWO: httpApiTwo,
|
||||||
HTTP_REQUEST_URL_THREE: httpApiThree,
|
HTTP_REQUEST_URL_THREE: httpApiThree,
|
||||||
HTTP_REQUEST_URL_FOUR: httpApiFour,
|
|
||||||
HTTP_REQUEST_URL_FIVE: httpApiFive,
|
|
||||||
HTTP_REQUEST_URL_SIX: httpApiSix,
|
|
||||||
VUE_APP_WS_URL: `${wsApi}?type=user`,
|
VUE_APP_WS_URL: `${wsApi}?type=user`,
|
||||||
VUE_APP_WS_URL_ONE:wsApi_one,
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
//H5接口是浏览器地址
|
//H5接口是浏览器地址
|
||||||
HTTP_REQUEST_URL: process.env.NODE_ENV == 'development'? httpApi : window.location.protocol + "//" + window.location.host,
|
HTTP_REQUEST_URL: httpApi || window.location.protocol + "//" + window.location.host,
|
||||||
HTTP_REQUEST_URL_TWO: httpApiTwo,
|
HTTP_REQUEST_URL_TWO: httpApiTwo || window.location.protocol + "//" + window.location.host,
|
||||||
HTTP_REQUEST_URL_FIVE: httpApiFive,
|
|
||||||
HTTP_REQUEST_URL_SIX: httpApiSix,
|
|
||||||
HTTP_REQUEST_URL_FOUR: window.location.host == 'shop.lihaink.cn' ?'https://worker-task.lihaink.cn':window.location.host == 'test.shop.lihaink.cn'?'https://preview-worker-task.lihaink.cn':'https://ceshi-worker-task.lihaink.cn',
|
|
||||||
|
|
||||||
// 聊天长连接地址
|
// 聊天长连接地址
|
||||||
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
|
VUE_APP_WS_URL: wsApi ? `${wsApi}?type=user` : VUE_APP_WS_URL,
|
||||||
// #endif
|
// #endif
|
||||||
openPlantGrass: openPlantGrass,
|
openPlantGrass: openPlantGrass,
|
||||||
ENV: env,
|
|
||||||
OSS_URL: ossUrl,
|
|
||||||
|
|
||||||
HEADER: {
|
HEADER: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
//#ifdef H5
|
//#ifdef H5
|
||||||
|
@ -38,6 +38,4 @@ module.exports = {
|
|||||||
CACHE_LONGITUDE: 'LONGITUDE',
|
CACHE_LONGITUDE: 'LONGITUDE',
|
||||||
//缓存纬度
|
//缓存纬度
|
||||||
CACHE_LATITUDE: 'LATITUDE',
|
CACHE_LATITUDE: 'LATITUDE',
|
||||||
//缓存地址信息
|
|
||||||
ADRESS_LOCATION:'ADRESS_LOCATION'
|
|
||||||
}
|
}
|
||||||
|
@ -130,7 +130,6 @@ export function Modal(title = '提示', content = '这是一个模态弹窗!', o
|
|||||||
}) {
|
}) {
|
||||||
return new Promise((reslove, reject) => {
|
return new Promise((reslove, reject) => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
...obj,
|
|
||||||
title: title,
|
title: title,
|
||||||
content: content,
|
content: content,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
|
23
main.js
23
main.js
@ -12,32 +12,22 @@ import App from './App'
|
|||||||
import store from './store'
|
import store from './store'
|
||||||
import Cache from './utils/cache'
|
import Cache from './utils/cache'
|
||||||
import util from 'utils/util'
|
import util from 'utils/util'
|
||||||
import {
|
import { HTTP_REQUEST_URL } from '@/config/app';
|
||||||
HTTP_REQUEST_URL
|
|
||||||
} from '@/config/app';
|
|
||||||
import skeleton from './components/skeleton/index.vue'
|
import skeleton from './components/skeleton/index.vue'
|
||||||
import BaseMoney from './components/BaseMoney.vue';
|
import BaseMoney from './components/BaseMoney.vue';
|
||||||
import Loading from './components/Loading.vue';
|
|
||||||
import activityHome from './components/activityHome.vue';
|
|
||||||
import uView from '@/uni_modules/uview-ui'
|
import uView from '@/uni_modules/uview-ui'
|
||||||
Vue.use(uView)
|
Vue.use(uView)
|
||||||
Vue.component('skeleton', skeleton)
|
Vue.component('skeleton', skeleton)
|
||||||
Vue.component('BaseMoney', BaseMoney)
|
Vue.component('BaseMoney', BaseMoney)
|
||||||
Vue.component('Loading', Loading)
|
|
||||||
Vue.component('activityHome', activityHome)
|
|
||||||
Vue.prototype.$util = util;
|
Vue.prototype.$util = util;
|
||||||
Vue.prototype.$Cache = Cache;
|
Vue.prototype.$Cache = Cache;
|
||||||
Vue.prototype.$eventHub = new Vue();
|
Vue.prototype.$eventHub = new Vue();
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
Vue.prototype.$bus = new Vue();
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
import {
|
import { parseQuery } from "./utils";
|
||||||
parseQuery
|
|
||||||
} from "./utils";
|
|
||||||
import Auth from './libs/wechat';
|
import Auth from './libs/wechat';
|
||||||
import {
|
import { SPREAD } from './config/cache';
|
||||||
SPREAD
|
|
||||||
} from './config/cache';
|
|
||||||
// import wx from '@/node_modules/jweixin-module/lib/index'
|
// import wx from '@/node_modules/jweixin-module/lib/index'
|
||||||
var __s = document.createElement('script');
|
var __s = document.createElement('script');
|
||||||
__s.src = HTTP_REQUEST_URL + "/api/script";
|
__s.src = HTTP_REQUEST_URL + "/api/script";
|
||||||
@ -96,11 +86,6 @@ Vue.directive('debounce', {
|
|||||||
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
let appInfo = uni.getSystemInfo().then(res => {
|
|
||||||
Vue.prototype.$appInfo = res[1];
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
|
|
||||||
|
|
||||||
|
230
manifest.json
230
manifest.json
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name" : "惠农生活",
|
"name" : "CRMEB",
|
||||||
"appid" : "__UNI__3A527D1",
|
"appid" : "__UNI__039BCFE",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.8.0",
|
"versionName" : "1.0.4",
|
||||||
"versionCode" : 180,
|
"versionCode" : 127,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@ -12,11 +12,8 @@
|
|||||||
"nvueCompiler" : "uni-app",
|
"nvueCompiler" : "uni-app",
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
"compatible" : {
|
|
||||||
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
|
|
||||||
},
|
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender" : false,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting" : true,
|
"waiting" : true,
|
||||||
"autoclose" : true,
|
"autoclose" : true,
|
||||||
"delay" : 0
|
"delay" : 0
|
||||||
@ -27,17 +24,7 @@
|
|||||||
"iBeacon" : {},
|
"iBeacon" : {},
|
||||||
"Barcode" : {},
|
"Barcode" : {},
|
||||||
"Camera" : {},
|
"Camera" : {},
|
||||||
"Geolocation" : {},
|
"Geolocation" : {}
|
||||||
"Payment" : {},
|
|
||||||
"Share" : {},
|
|
||||||
"OAuth" : {},
|
|
||||||
"UniMP" : {
|
|
||||||
"description" : "uni小程序"
|
|
||||||
},
|
|
||||||
"Maps" : {},
|
|
||||||
"Push" : {},
|
|
||||||
"LivePusher" : {},
|
|
||||||
"Record" : {}
|
|
||||||
},
|
},
|
||||||
"safearea" : {
|
"safearea" : {
|
||||||
"bottom" : {
|
"bottom" : {
|
||||||
@ -50,13 +37,7 @@
|
|||||||
"android" : {
|
"android" : {
|
||||||
"resizeableActivity" : true,
|
"resizeableActivity" : true,
|
||||||
"permissions" : [
|
"permissions" : [
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
|
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
|
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>",
|
||||||
@ -64,18 +45,10 @@
|
|||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
|
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
|
||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||||
"permissionExternalStorage" : {
|
"permissionExternalStorage" : {
|
||||||
@ -84,9 +57,7 @@
|
|||||||
},
|
},
|
||||||
"permissionPhoneState" : {
|
"permissionPhoneState" : {
|
||||||
"request" : "none" //拨打电话权限关闭
|
"request" : "none" //拨打电话权限关闭
|
||||||
},
|
}
|
||||||
"targetSdkVersion" : 30,
|
|
||||||
"minSdkVersion" : 23
|
|
||||||
},
|
},
|
||||||
/* ios打包配置 */
|
/* ios打包配置 */
|
||||||
"ios" : {
|
"ios" : {
|
||||||
@ -95,9 +66,7 @@
|
|||||||
"NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报",
|
"NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报",
|
||||||
"NSCameraUsageDescription" : "上传用户头像保存分享海报",
|
"NSCameraUsageDescription" : "上传用户头像保存分享海报",
|
||||||
"NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
|
"NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
|
||||||
"NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店",
|
"NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店"
|
||||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
|
|
||||||
"NSMicrophoneUsageDescription" : "根据用户录音进行语音识别转文字"
|
|
||||||
},
|
},
|
||||||
"idfa" : false,
|
"idfa" : false,
|
||||||
"dSYMs" : false
|
"dSYMs" : false
|
||||||
@ -106,35 +75,31 @@
|
|||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
"maps" : {
|
"maps" : {
|
||||||
"amap" : {
|
"amap" : {
|
||||||
"appkey_ios" : "82af93ec51139c712c4118d84ba684ee",
|
"appkey_ios" : "",
|
||||||
"appkey_android" : "0799f37420c0784f1e6cba230a68bdb1",
|
"appkey_android" : ""
|
||||||
"name" : "amap_18982406440DFVLElaO"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"payment" : {
|
"payment" : {
|
||||||
"weixin" : {
|
"alipay" : {
|
||||||
"__platform__" : [ "ios", "android" ],
|
"__platform__" : [ "ios", "android" ]
|
||||||
"appid" : "wx9d68c92b550ddd1e",
|
|
||||||
"UniversalLinks" : "https://shop.lihaink.cn/"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "wx9d68c92b550ddd1e",
|
"appid" : "",
|
||||||
"UniversalLinks" : "https://shop.lihaink.cn/"
|
"UniversalLinks" : "https://mer.crmeb.net/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"geolocation" : {
|
"geolocation" : {
|
||||||
"amap" : {
|
"system" : {
|
||||||
"__platform__" : [ "ios", "android" ],
|
"__platform__" : [ "ios", "android" ]
|
||||||
"appkey_ios" : "82af93ec51139c712c4118d84ba684ee",
|
|
||||||
"appkey_android" : "0799f37420c0784f1e6cba230a68bdb1",
|
|
||||||
"name" : "amap_18982406440DFVLElaO"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth" : {},
|
"push" : {},
|
||||||
"ad" : {},
|
"oauth" : {
|
||||||
"push" : {}
|
"apple" : {}
|
||||||
|
},
|
||||||
|
"ad" : {}
|
||||||
},
|
},
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"android" : {
|
"android" : {
|
||||||
@ -169,145 +134,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"useOriginalMsgbox" : true,
|
"useOriginalMsgbox" : true
|
||||||
"androidStyle" : "default",
|
|
||||||
"iosStyle" : "common",
|
|
||||||
"ios" : {
|
|
||||||
"storyboard" : "C:/Users/ghf/Downloads/CustomStoryboard.zip"
|
|
||||||
},
|
|
||||||
"android" : {
|
|
||||||
"hdpi" : "",
|
|
||||||
"xhdpi" : "",
|
|
||||||
"xxhdpi" : "static/images/guide.png"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nativePlugins" : {
|
|
||||||
"JG-JCore" : {
|
|
||||||
"JPUSH_APPKEY_IOS" : "8a5efd65cda14fafa6e64ad3",
|
|
||||||
"JPUSH_CHANNEL_IOS" : "8a5efd65cda14fafa6e64ad3",
|
|
||||||
"JPUSH_APPKEY_ANDROID" : "b5f679f4357018605ea6fd2e",
|
|
||||||
"JPUSH_CHANNEL_ANDROID" : "",
|
|
||||||
"__plugin_info__" : {
|
|
||||||
"name" : "JG-JCore",
|
|
||||||
"description" : "极光推送JCore插件",
|
|
||||||
"platforms" : "Android,iOS",
|
|
||||||
"url" : "",
|
|
||||||
"android_package_name" : "uni.UNI3A527D1",
|
|
||||||
"ios_bundle_id" : "",
|
|
||||||
"isCloud" : false,
|
|
||||||
"bought" : -1,
|
|
||||||
"pid" : "",
|
|
||||||
"parameters" : {
|
|
||||||
"JPUSH_APPKEY_IOS" : {
|
|
||||||
"des" : "[iOS]极光portal配置应用信息时分配的AppKey",
|
|
||||||
"key" : "JCore:APP_KEY",
|
|
||||||
"value" : "daebe19b547c43128796a078"
|
|
||||||
},
|
|
||||||
"JPUSH_CHANNEL_IOS" : {
|
|
||||||
"des" : "[iOS]用于统计分发渠道,不需要可填默认值developer-default",
|
|
||||||
"key" : "JCore:CHANNEL",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_APPKEY_ANDROID" : {
|
|
||||||
"des" : "[Android]极光portal配置应用信息时分配的AppKey",
|
|
||||||
"key" : "JPUSH_APPKEY",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_CHANNEL_ANDROID" : {
|
|
||||||
"des" : "[Android]用于统计分发渠道,不需要可填默认值developer-default",
|
|
||||||
"key" : "JPUSH_CHANNEL",
|
|
||||||
"value" : ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"JG-JPush" : {
|
|
||||||
"JPUSH_ISPRODUCTION_IOS" : "true",
|
|
||||||
"JPUSH_ADVERTISINGID_IOS" : "",
|
|
||||||
"JPUSH_DEFAULTINITJPUSH_IOS" : "true",
|
|
||||||
"JPUSH_OPPO_APPKEY" : "",
|
|
||||||
"JPUSH_OPPO_APPID" : "",
|
|
||||||
"JPUSH_OPPO_APPSECRET" : "",
|
|
||||||
"JPUSH_VIVO_APPKEY" : "",
|
|
||||||
"JPUSH_VIVO_APPID" : "",
|
|
||||||
"JPUSH_MEIZU_APPKEY" : "",
|
|
||||||
"JPUSH_MEIZU_APPID" : "",
|
|
||||||
"JPUSH_XIAOMI_APPKEY" : "",
|
|
||||||
"JPUSH_XIAOMI_APPID" : "",
|
|
||||||
"__plugin_info__" : {
|
|
||||||
"name" : "JG-JPush",
|
|
||||||
"description" : "极光推送Hbuilder插件",
|
|
||||||
"platforms" : "Android,iOS",
|
|
||||||
"url" : "",
|
|
||||||
"android_package_name" : "uni.UNI3A527D1",
|
|
||||||
"ios_bundle_id" : "",
|
|
||||||
"isCloud" : false,
|
|
||||||
"bought" : -1,
|
|
||||||
"pid" : "",
|
|
||||||
"parameters" : {
|
|
||||||
"JPUSH_ISPRODUCTION_IOS" : {
|
|
||||||
"des" : "[iOS]是否是生产环境,是填true,不是填false或者不填",
|
|
||||||
"key" : "JPush:ISPRODUCTION",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_ADVERTISINGID_IOS" : {
|
|
||||||
"des" : "[iOS]广告标识符(IDFA)如果不需要使用IDFA,可不填",
|
|
||||||
"key" : "JPush:ADVERTISINGID",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_DEFAULTINITJPUSH_IOS" : {
|
|
||||||
"des" : "[iOS]是否默认初始化,是填true,不是填false或者不填",
|
|
||||||
"key" : "JPush:DEFAULTINITJPUSH",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_OPPO_APPKEY" : {
|
|
||||||
"des" : "厂商OPPO-appkey,示例:OP-12345678",
|
|
||||||
"key" : "OPPO_APPKEY",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_OPPO_APPID" : {
|
|
||||||
"des" : "厂商OPPO-appId,示例:OP-12345678",
|
|
||||||
"key" : "OPPO_APPID",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_OPPO_APPSECRET" : {
|
|
||||||
"des" : "厂商OPPO-appSecret,示例:OP-12345678",
|
|
||||||
"key" : "OPPO_APPSECRET",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_VIVO_APPKEY" : {
|
|
||||||
"des" : "厂商VIVO-appkey,示例:12345678",
|
|
||||||
"key" : "com.vivo.push.api_key",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_VIVO_APPID" : {
|
|
||||||
"des" : "厂商VIVO-appId,示例:12345678",
|
|
||||||
"key" : "com.vivo.push.app_id",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_MEIZU_APPKEY" : {
|
|
||||||
"des" : "厂商MEIZU-appKey,示例:MZ-12345678",
|
|
||||||
"key" : "MEIZU_APPKEY",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_MEIZU_APPID" : {
|
|
||||||
"des" : "厂商MEIZU-appId,示例:MZ-12345678",
|
|
||||||
"key" : "MEIZU_APPID",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_XIAOMI_APPKEY" : {
|
|
||||||
"des" : "厂商XIAOMI-appKey,示例:MI-12345678",
|
|
||||||
"key" : "XIAOMI_APPKEY",
|
|
||||||
"value" : ""
|
|
||||||
},
|
|
||||||
"JPUSH_XIAOMI_APPID" : {
|
|
||||||
"des" : "厂商XIAOMI-appId,示例:MI-12345678",
|
|
||||||
"key" : "XIAOMI_APPID",
|
|
||||||
"value" : ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -350,10 +177,8 @@
|
|||||||
"domain" : "",
|
"domain" : "",
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
"maps" : {
|
"maps" : {
|
||||||
"amap" : {
|
"qqmap" : {
|
||||||
"key" : "275cd3601b1b2d6414f6c988e7911664",
|
"key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
|
||||||
"securityJsCode" : "d2d7c56801819e8bdf71b8a71846f235",
|
|
||||||
"serviceHost" : ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -361,6 +186,3 @@
|
|||||||
"template" : "template.h5.html"
|
"template" : "template.h5.html"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//拨打电话权限关闭
|
|
||||||
/* ios打包配置 */
|
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,27 +0,0 @@
|
|||||||
//
|
|
||||||
// JGInforCollectionAuth.h
|
|
||||||
// JCore
|
|
||||||
//
|
|
||||||
// Created by 豆瓣 on 2021/10/27.
|
|
||||||
// Copyright © 2021 jiguang. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
/// 合规接口,是否授权极光采集一定的设备信息
|
|
||||||
@interface JGInforCollectionAuthItems : NSObject
|
|
||||||
/// 是否授权,默认YES
|
|
||||||
@property(nonatomic,assign)BOOL isAuth;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@interface JGInforCollectionAuth : NSObject
|
|
||||||
|
|
||||||
/// 设备信息采集授权接口(合规接口)
|
|
||||||
/// 请务必在调用初始化、功能性接口前调用此接口进行合规授权
|
|
||||||
/// @param authBlock auth:YES 则极光认为您同意极光采集一定的设备信息
|
|
||||||
+(void)JCollectionAuth:(void(^_Nullable)(JGInforCollectionAuthItems *authInfo))authBlock;
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
@ -1,17 +0,0 @@
|
|||||||
//
|
|
||||||
// JCoreModule.h
|
|
||||||
// UniPluginJCore
|
|
||||||
//
|
|
||||||
// Created by huangshuni on 2021/1/21.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import "DCUniModule.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface JCoreModule : DCUniModule
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>files</key>
|
|
||||||
<dict>
|
|
||||||
<key>Headers/JCoreModule.h</key>
|
|
||||||
<data>
|
|
||||||
4aMcBALZuuQeh2JQjJqqvSkc2mA=
|
|
||||||
</data>
|
|
||||||
<key>Info.plist</key>
|
|
||||||
<data>
|
|
||||||
06+wBVr403G+lX5fr/4efqHMj2A=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
<key>files2</key>
|
|
||||||
<dict>
|
|
||||||
<key>Headers/JCoreModule.h</key>
|
|
||||||
<dict>
|
|
||||||
<key>hash</key>
|
|
||||||
<data>
|
|
||||||
4aMcBALZuuQeh2JQjJqqvSkc2mA=
|
|
||||||
</data>
|
|
||||||
<key>hash2</key>
|
|
||||||
<data>
|
|
||||||
h/0w2CaU3JBhKI3Pp4EiSWqLf/ZY1Ju+5+tBAdowZ5k=
|
|
||||||
</data>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>rules</key>
|
|
||||||
<dict>
|
|
||||||
<key>^.*</key>
|
|
||||||
<true/>
|
|
||||||
<key>^.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version.plist$</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
<key>rules2</key>
|
|
||||||
<dict>
|
|
||||||
<key>.*\.dSYM($|/)</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>11</real>
|
|
||||||
</dict>
|
|
||||||
<key>^(.*/)?\.DS_Store$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>2000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*</key>
|
|
||||||
<true/>
|
|
||||||
<key>^.*\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>optional</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1000</real>
|
|
||||||
</dict>
|
|
||||||
<key>^.*\.lproj/locversion.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1100</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Base\.lproj/</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>1010</real>
|
|
||||||
</dict>
|
|
||||||
<key>^Info\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^PkgInfo$</key>
|
|
||||||
<dict>
|
|
||||||
<key>omit</key>
|
|
||||||
<true/>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^embedded\.provisionprofile$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
<key>^version\.plist$</key>
|
|
||||||
<dict>
|
|
||||||
<key>weight</key>
|
|
||||||
<real>20</real>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
Binary file not shown.
Binary file not shown.
@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "JG-JCore",
|
|
||||||
"id": "JG-JCore",
|
|
||||||
"version": "1.1.3",
|
|
||||||
"description": "极光推送JCore插件",
|
|
||||||
"_dp_type":"nativeplugin",
|
|
||||||
"_dp_nativeplugin":{
|
|
||||||
"ios": {
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"type": "module",
|
|
||||||
"name": "JG-JCore",
|
|
||||||
"class": "JCoreModule"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"integrateType": "framework",
|
|
||||||
"deploymentTarget": "11.0",
|
|
||||||
"validArchitectures": [
|
|
||||||
"arm64"
|
|
||||||
],
|
|
||||||
"parameters": {
|
|
||||||
"JPUSH_APPKEY_IOS": {
|
|
||||||
"des": "[iOS]极光portal配置应用信息时分配的AppKey",
|
|
||||||
"key": "JCore:APP_KEY"
|
|
||||||
},
|
|
||||||
"JPUSH_CHANNEL_IOS": {
|
|
||||||
"des": "[iOS]用于统计分发渠道,不需要可填默认值developer-default",
|
|
||||||
"key": "JCore:CHANNEL"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"android": {
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"type": "module",
|
|
||||||
"name": "JG-JCore",
|
|
||||||
"class": "cn.jiguang.uniplugin_jcore.JCoreModule"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"integrateType": "aar",
|
|
||||||
"minSdkVersion": "19",
|
|
||||||
"permissions": [
|
|
||||||
],
|
|
||||||
"abis": [
|
|
||||||
"armeabi-v7a",
|
|
||||||
"arm64-v8a",
|
|
||||||
"x86"
|
|
||||||
],
|
|
||||||
"parameters": {
|
|
||||||
"JPUSH_APPKEY_ANDROID": {
|
|
||||||
"des": "[Android]极光portal配置应用信息时分配的AppKey",
|
|
||||||
"key": "JPUSH_APPKEY"
|
|
||||||
},
|
|
||||||
"JPUSH_CHANNEL_ANDROID":{
|
|
||||||
"des": "[Android]用于统计分发渠道,不需要可填默认值developer-default",
|
|
||||||
"key": "JPUSH_CHANNEL"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,798 +0,0 @@
|
|||||||
/*
|
|
||||||
* | | | | \ \ / / | | | | / _______|
|
|
||||||
* | |____| | \ \/ / | |____| | / /
|
|
||||||
* | |____| | \ / | |____| | | | _____
|
|
||||||
* | | | | / \ | | | | | | |____ |
|
|
||||||
* | | | | / /\ \ | | | | \ \______| |
|
|
||||||
* | | | | /_/ \_\ | | | | \_________|
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011 ~ 2017 Shenzhen HXHG. All rights reserved.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define JPUSH_VERSION_NUMBER 3.4.0
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@class CLRegion;
|
|
||||||
@class UILocalNotification;
|
|
||||||
@class CLLocation;
|
|
||||||
@class UNNotificationCategory;
|
|
||||||
@class UNNotificationSettings;
|
|
||||||
@class UNNotificationRequest;
|
|
||||||
@class UNNotification;
|
|
||||||
@protocol JPUSHRegisterDelegate;
|
|
||||||
@protocol JPUSHGeofenceDelegate;
|
|
||||||
@protocol JPushInMessageDelegate;
|
|
||||||
|
|
||||||
typedef void (^JPUSHTagsOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq);
|
|
||||||
typedef void (^JPUSHTagValidOperationCompletion)(NSInteger iResCode, NSSet *iTags, NSInteger seq, BOOL isBind);
|
|
||||||
typedef void (^JPUSHAliasOperationCompletion)(NSInteger iResCode, NSString *iAlias, NSInteger seq);
|
|
||||||
typedef void (^JPUSHInMssageCompletion)(NSInteger iResCode);
|
|
||||||
|
|
||||||
extern NSString *const kJPFNetworkIsConnectingNotification; // 正在连接中
|
|
||||||
extern NSString *const kJPFNetworkDidSetupNotification; // 建立连接
|
|
||||||
extern NSString *const kJPFNetworkDidCloseNotification; // 关闭连接
|
|
||||||
extern NSString *const kJPFNetworkDidRegisterNotification; // 注册成功
|
|
||||||
extern NSString *const kJPFNetworkFailedRegisterNotification; //注册失败
|
|
||||||
extern NSString *const kJPFNetworkDidLoginNotification; // 登录成功
|
|
||||||
extern NSString *const kJPFNetworkDidReceiveMessageNotification; // 收到消息(非APNS)
|
|
||||||
extern NSString *const kJPFServiceErrorNotification; // 错误提示
|
|
||||||
|
|
||||||
typedef NS_OPTIONS(NSUInteger, JPAuthorizationOptions) {
|
|
||||||
JPAuthorizationOptionNone = 0, // the application may not present any UI upon a notification being received
|
|
||||||
JPAuthorizationOptionBadge = (1 << 0), // the application may badge its icon upon a notification being received
|
|
||||||
JPAuthorizationOptionSound = (1 << 1), // the application may play a sound upon a notification being received
|
|
||||||
JPAuthorizationOptionAlert = (1 << 2), // the application may display an alert upon a notification being received
|
|
||||||
JPAuthorizationOptionCarPlay = (1 << 3), // The ability to display notifications in a CarPlay environment.
|
|
||||||
JPAuthorizationOptionCriticalAlert NS_AVAILABLE_IOS(12.0) = (1 << 4) , //The ability to play sounds for critical alerts.
|
|
||||||
JPAuthorizationOptionProvidesAppNotificationSettings NS_AVAILABLE_IOS(12.0) = (1 << 5) , //An option indicating the system should display a button for in-app notification settings.
|
|
||||||
JPAuthorizationOptionProvisional NS_AVAILABLE_IOS(12.0) = (1 << 6) , //The ability to post noninterrupting notifications provisionally to the Notification Center.
|
|
||||||
JPAuthorizationOptionAnnouncement NS_AVAILABLE_IOS(13.0) = (1 << 7) , //The ability for Siri to automatically read out messages over AirPods.
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, JPAuthorizationStatus) {
|
|
||||||
JPAuthorizationNotDetermined = 0, // The user has not yet made a choice regarding whether the application may post user notifications.
|
|
||||||
JPAuthorizationStatusDenied, // The application is not authorized to post user notifications.
|
|
||||||
JPAuthorizationStatusAuthorized, // The application is authorized to post user notifications.
|
|
||||||
JPAuthorizationStatusProvisional NS_AVAILABLE_IOS(12.0), // The application is authorized to post non-interruptive user notifications.
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef NS_ENUM(NSInteger,JPushInMessageContentType){
|
|
||||||
JPushAdContentType = 1, //广告类型的inMessage
|
|
||||||
JPushNotiContentType = 2, //通知类型的inMessage
|
|
||||||
};
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 通知注册实体类
|
|
||||||
*/
|
|
||||||
@interface JPUSHRegisterEntity : NSObject
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 支持的类型
|
|
||||||
* badge,sound,alert
|
|
||||||
*/
|
|
||||||
@property (nonatomic, assign) NSInteger types;
|
|
||||||
/*!
|
|
||||||
* 注入的类别
|
|
||||||
* iOS10 UNNotificationCategory
|
|
||||||
* iOS8-iOS9 UIUserNotificationCategory
|
|
||||||
*/
|
|
||||||
@property (nonatomic, strong) NSSet *categories;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 进行删除、查找推送实体类
|
|
||||||
*/
|
|
||||||
@interface JPushNotificationIdentifier : NSObject<NSCopying, NSCoding>
|
|
||||||
|
|
||||||
@property (nonatomic, copy) NSArray<NSString *> *identifiers; // 推送的标识数组
|
|
||||||
@property (nonatomic, copy) UILocalNotification *notificationObj NS_DEPRECATED_IOS(4_0, 10_0); // iOS10以下可以传UILocalNotification对象数据,iOS10以上无效
|
|
||||||
@property (nonatomic, assign) BOOL delivered NS_AVAILABLE_IOS(10_0); // 在通知中心显示的或待推送的标志,默认为NO,YES表示在通知中心显示的,NO表示待推送的
|
|
||||||
@property (nonatomic, copy) void (^findCompletionHandler)(NSArray *results); // 用于查询回调,调用[findNotification:]方法前必须设置,results为返回相应对象数组,iOS10以下返回UILocalNotification对象数组;iOS10以上根据delivered传入值返回UNNotification或UNNotificationRequest对象数组(delivered传入YES,则返回UNNotification对象数组,否则返回UNNotificationRequest对象数组)
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 推送通知声音实体类
|
|
||||||
* iOS10以上有效
|
|
||||||
*/
|
|
||||||
@interface JPushNotificationSound : NSObject <NSCopying, NSCoding>
|
|
||||||
@property (nonatomic, copy) NSString *soundName; //普通通知铃声
|
|
||||||
@property (nonatomic, copy) NSString *criticalSoundName NS_AVAILABLE_IOS(12.0); //警告通知铃声
|
|
||||||
@property (nonatomic, assign) float criticalSoundVolume NS_AVAILABLE_IOS(12.0); //警告通知铃声音量,有效值在0~1之间,默认为1
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 推送内容实体类
|
|
||||||
*/
|
|
||||||
@interface JPushNotificationContent : NSObject<NSCopying, NSCoding>
|
|
||||||
|
|
||||||
@property (nonatomic, copy) NSString *title; // 推送标题
|
|
||||||
@property (nonatomic, copy) NSString *subtitle; // 推送副标题
|
|
||||||
@property (nonatomic, copy) NSString *body; // 推送内容
|
|
||||||
@property (nonatomic, copy) NSNumber *badge; // 角标的数字。如果不需要改变角标传@(-1)
|
|
||||||
@property (nonatomic, copy) NSString *action NS_DEPRECATED_IOS(8_0, 10_0); // 弹框的按钮显示的内容(IOS 8默认为"打开", 其他默认为"启动",iOS10以上无效)
|
|
||||||
@property (nonatomic, copy) NSString *categoryIdentifier; // 行为分类标识
|
|
||||||
@property (nonatomic, copy) NSDictionary *userInfo; // 本地推送时可以设置userInfo来增加附加信息,远程推送时设置的payload推送内容作为此userInfo
|
|
||||||
@property (nonatomic, copy) NSString *sound; // 声音名称,不设置则为默认声音
|
|
||||||
@property (nonatomic, copy) JPushNotificationSound *soundSetting NS_AVAILABLE_IOS(10.0); //推送声音实体
|
|
||||||
@property (nonatomic, copy) NSArray *attachments NS_AVAILABLE_IOS(10_0); // 附件,iOS10以上有效,需要传入UNNotificationAttachment对象数组类型
|
|
||||||
@property (nonatomic, copy) NSString *threadIdentifier NS_AVAILABLE_IOS(10_0); // 线程或与推送请求相关对话的标识,iOS10以上有效,可用来对推送进行分组
|
|
||||||
@property (nonatomic, copy) NSString *launchImageName NS_AVAILABLE_IOS(10_0); // 启动图片名,iOS10以上有效,从推送启动时将会用到
|
|
||||||
@property (nonatomic, copy) NSString *summaryArgument NS_AVAILABLE_IOS(12.0); //插入到通知摘要中的部分参数。iOS12以上有效。
|
|
||||||
@property (nonatomic, assign) NSUInteger summaryArgumentCount NS_AVAILABLE_IOS(12.0); //插入到通知摘要中的项目数。iOS12以上有效。
|
|
||||||
@property (nonatomic, copy) NSString *targetContentIdentifier NS_AVAILABLE_IOS(13.0); // An identifier for the content of the notification used by the system to customize the scene to be activated when tapping on a notification.
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 推送触发方式实体类
|
|
||||||
* 注:dateComponents、timeInterval、region在iOS10以上可选择其中一个参数传入有效值,如果同时传入值会根据优先级I、II、III使其中一种触发方式生效,fireDate为iOS10以下根据时间触发时须传入的参数
|
|
||||||
*/
|
|
||||||
@interface JPushNotificationTrigger : NSObject<NSCopying, NSCoding>
|
|
||||||
|
|
||||||
@property (nonatomic, assign) BOOL repeat; // 设置是否重复,默认为NO
|
|
||||||
@property (nonatomic, copy) NSDate *fireDate NS_DEPRECATED_IOS(2_0, 10_0); // 用来设置触发推送的时间,iOS10以上无效
|
|
||||||
@property (nonatomic, copy) CLRegion *region NS_AVAILABLE_IOS(8_0); // 用来设置触发推送的位置,iOS8以上有效,iOS10以上优先级为I,应用需要有允许使用定位的授权
|
|
||||||
@property (nonatomic, copy) NSDateComponents *dateComponents NS_AVAILABLE_IOS(10_0); // 用来设置触发推送的日期时间,iOS10以上有效,优先级为II
|
|
||||||
@property (nonatomic, assign) NSTimeInterval timeInterval NS_AVAILABLE_IOS(10_0); // 用来设置触发推送的时间,iOS10以上有效,优先级为III
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 注册或更新推送实体类
|
|
||||||
*/
|
|
||||||
@interface JPushNotificationRequest : NSObject<NSCopying, NSCoding>
|
|
||||||
|
|
||||||
@property (nonatomic, copy) NSString *requestIdentifier; // 推送请求标识
|
|
||||||
@property (nonatomic, copy) JPushNotificationContent *content; // 设置推送的具体内容
|
|
||||||
@property (nonatomic, copy) JPushNotificationTrigger *trigger; // 设置推送的触发方式
|
|
||||||
@property (nonatomic, copy) void (^completionHandler)(id result); // 注册或更新推送成功回调,iOS10以上成功则result为UNNotificationRequest对象,失败则result为nil;iOS10以下成功result为UILocalNotification对象,失败则result为nil
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* JPush 核心头文件
|
|
||||||
*/
|
|
||||||
@interface JPUSHService : NSObject
|
|
||||||
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Setup 启动相关
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 启动SDK
|
|
||||||
*
|
|
||||||
* @param launchingOption 启动参数.
|
|
||||||
* @param appKey 一个JPush 应用必须的,唯一的标识. 请参考 JPush 相关说明文档来获取这个标识.
|
|
||||||
* @param channel 发布渠道. 可选.
|
|
||||||
* @param isProduction 是否生产环境. 如果为开发状态,设置为 NO; 如果为生产状态,应改为 YES.
|
|
||||||
* App 证书环境取决于profile provision的配置,此处建议与证书环境保持一致.
|
|
||||||
*
|
|
||||||
* @discussion 提供SDK启动必须的参数, 来启动 SDK.
|
|
||||||
* 此接口必须在 App 启动时调用, 否则 JPush SDK 将无法正常工作.
|
|
||||||
*/
|
|
||||||
+ (void)setupWithOption:(NSDictionary *)launchingOption
|
|
||||||
appKey:(NSString *)appKey
|
|
||||||
channel:(NSString *)channel
|
|
||||||
apsForProduction:(BOOL)isProduction;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 启动SDK
|
|
||||||
*
|
|
||||||
* @param launchingOption 启动参数.
|
|
||||||
* @param appKey 一个JPush 应用必须的,唯一的标识. 请参考 JPush 相关说明文档来获取这个标识.
|
|
||||||
* @param channel 发布渠道. 可选.
|
|
||||||
* @param isProduction 是否生产环境. 如果为开发状态,设置为 NO; 如果为生产状态,应改为 YES.
|
|
||||||
* App 证书环境取决于profile provision的配置,此处建议与证书环境保持一致.
|
|
||||||
* @param advertisingId 广告标识符(IDFA) 如果不需要使用IDFA,传nil.
|
|
||||||
*
|
|
||||||
* @discussion 提供SDK启动必须的参数, 来启动 SDK.
|
|
||||||
* 此接口必须在 App 启动时调用, 否则 JPush SDK 将无法正常工作.
|
|
||||||
*/
|
|
||||||
+ (void)setupWithOption:(NSDictionary *)launchingOption
|
|
||||||
appKey:(NSString *)appKey
|
|
||||||
channel:(NSString *)channel
|
|
||||||
apsForProduction:(BOOL)isProduction
|
|
||||||
advertisingIdentifier:(NSString *)advertisingId;
|
|
||||||
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name APNs about 通知相关
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 注册要处理的远程通知类型
|
|
||||||
*
|
|
||||||
* @param types 通知类型
|
|
||||||
* @param categories 类别组
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)registerForRemoteNotificationTypes:(NSUInteger)types
|
|
||||||
categories:(NSSet *)categories;
|
|
||||||
/*!
|
|
||||||
* @abstract 新版本的注册方法(兼容iOS10)
|
|
||||||
*
|
|
||||||
* @param config 注册通知配置
|
|
||||||
* @param delegate 代理
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)registerForRemoteNotificationConfig:(JPUSHRegisterEntity *)config delegate:(id<JPUSHRegisterDelegate>)delegate;
|
|
||||||
|
|
||||||
|
|
||||||
+ (void)registerDeviceToken:(NSData *)deviceToken;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 处理收到的 APNs 消息
|
|
||||||
*/
|
|
||||||
+ (void)handleRemoteNotification:(NSDictionary *)remoteInfo;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 向极光服务器提交Token
|
|
||||||
*
|
|
||||||
* @param voipToken 推送使用的Voip Token
|
|
||||||
*/
|
|
||||||
+ (void)registerVoipToken:(NSData *)voipToken;
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 处理收到的 Voip 消息
|
|
||||||
*
|
|
||||||
* @param remoteInfo 下发的 Voip 内容
|
|
||||||
*/
|
|
||||||
+ (void)handleVoipNotification:(NSDictionary *)remoteInfo;
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 检测通知授权状态
|
|
||||||
* @param completion 授权结果通过status值返回,详见JPAuthorizationStatus
|
|
||||||
*/
|
|
||||||
+ (void)requestNotificationAuthorization:(void (^)(JPAuthorizationStatus status))completion;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 跳转至系统设置页面,iOS8及以上有效
|
|
||||||
*/
|
|
||||||
+ (void)openSettingsForNotification:(void (^)(BOOL success))completionHandler NS_AVAILABLE_IOS(8_0);
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* Tags操作接口
|
|
||||||
* 支持增加/覆盖/删除/清空/查询操作
|
|
||||||
* 详情请参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_api/)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
增加tags
|
|
||||||
|
|
||||||
@param tags 需要增加的tags集合
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)addTags:(NSSet<NSString *> *)tags
|
|
||||||
completion:(JPUSHTagsOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
覆盖tags
|
|
||||||
调用该接口会覆盖用户所有的tags
|
|
||||||
|
|
||||||
@param tags 需要设置的tags集合
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)setTags:(NSSet<NSString *> *)tags
|
|
||||||
completion:(JPUSHTagsOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
删除指定tags
|
|
||||||
|
|
||||||
@param tags 需要删除的tags集合
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)deleteTags:(NSSet<NSString *> *)tags
|
|
||||||
completion:(JPUSHTagsOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
清空所有tags
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)cleanTags:(JPUSHTagsOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
查询全部tags
|
|
||||||
|
|
||||||
@param completion 响应回调,请在回调中获取查询结果
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)getAllTags:(JPUSHTagsOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
验证tag是否绑定
|
|
||||||
|
|
||||||
@param completion 响应回调,回调中查看是否绑定
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)validTag:(NSString *)tag
|
|
||||||
completion:(JPUSHTagValidOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
设置Alias
|
|
||||||
|
|
||||||
@param alias 需要设置的alias
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)setAlias:(NSString *)alias
|
|
||||||
completion:(JPUSHAliasOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
删除alias
|
|
||||||
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)deleteAlias:(JPUSHAliasOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
/**
|
|
||||||
查询当前alias
|
|
||||||
|
|
||||||
@param completion 响应回调
|
|
||||||
@param seq 请求序列号
|
|
||||||
*/
|
|
||||||
+ (void)getAlias:(JPUSHAliasOperationCompletion)completion
|
|
||||||
seq:(NSInteger)seq;
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 过滤掉无效的 tags
|
|
||||||
*
|
|
||||||
* @discussion 如果 tags 数量超过限制数量, 则返回靠前的有效的 tags.
|
|
||||||
* 建议设置 tags 前用此接口校验. SDK 内部也会基于此接口来做过滤.
|
|
||||||
*/
|
|
||||||
+ (NSSet *)filterValidTags:(NSSet *)tags;
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Stats 统计功能
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 开始记录页面停留
|
|
||||||
*
|
|
||||||
* @param pageName 页面名称
|
|
||||||
* @discussion JCore 1.1.8 版本后,如需统计页面流,请使用 JAnalytics
|
|
||||||
*/
|
|
||||||
+ (void)startLogPageView:(NSString *)pageName __attribute__((deprecated("JCore 1.1.8 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 停止记录页面停留
|
|
||||||
*
|
|
||||||
* @param pageName 页面
|
|
||||||
* @discussion JCore 1.1.8 版本后,如需统计页面流,请使用 JAnalytics
|
|
||||||
*/
|
|
||||||
+ (void)stopLogPageView:(NSString *)pageName __attribute__((deprecated("JCore 1.1.8 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 直接上报在页面的停留时间
|
|
||||||
*
|
|
||||||
* @param pageName 页面
|
|
||||||
* @param seconds 停留的秒数
|
|
||||||
* @discussion JCore 1.1.8 版本后,如需统计页面流,请使用 JAnalytics
|
|
||||||
*/
|
|
||||||
+ (void)beginLogPageView:(NSString *)pageName duration:(int)seconds __attribute__((deprecated("JCore 1.1.8 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 开启Crash日志收集
|
|
||||||
*
|
|
||||||
* @discussion 默认是关闭状态.
|
|
||||||
*/
|
|
||||||
+ (void)crashLogON;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 地理位置上报
|
|
||||||
*
|
|
||||||
* @param latitude 纬度.
|
|
||||||
* @param longitude 经度.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)setLatitude:(double)latitude longitude:(double)longitude;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 地理位置上报
|
|
||||||
*
|
|
||||||
* @param location 直接传递 CLLocation * 型的地理信息
|
|
||||||
*
|
|
||||||
* @discussion 需要链接 CoreLocation.framework 并且 #import <CoreLocation/CoreLocation.h>
|
|
||||||
*/
|
|
||||||
+ (void)setLocation:(CLLocation *)location;
|
|
||||||
|
|
||||||
/**
|
|
||||||
设置地理围栏的最大个数
|
|
||||||
默认值为 10 ,iOS系统默认地理围栏最大个数为20
|
|
||||||
@param count 个数 count
|
|
||||||
*/
|
|
||||||
+ (void)setGeofenecMaxCount:(NSInteger)count;
|
|
||||||
/**
|
|
||||||
注册地理围栏的代理
|
|
||||||
|
|
||||||
@param delegate 代理
|
|
||||||
@param launchOptions app启动完成是收到的字段参数
|
|
||||||
*/
|
|
||||||
+ (void)registerLbsGeofenceDelegate:(id<JPUSHGeofenceDelegate>)delegate withLaunchOptions:(NSDictionary *)launchOptions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
删除地理围栏
|
|
||||||
|
|
||||||
@param geofenceId 地理围栏id
|
|
||||||
*/
|
|
||||||
+ (void)removeGeofenceWithIdentifier:(NSString *)geofenceId;
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Local Notification 本地通知
|
|
||||||
///----------------------------------------------------
|
|
||||||
/*!
|
|
||||||
* @abstract 注册或更新推送 (支持iOS10,并兼容iOS10以下版本)
|
|
||||||
*
|
|
||||||
* JPush 2.1.9新接口
|
|
||||||
* @param request JPushNotificationRequest类型,设置推送的属性,设置已有推送的request.requestIdentifier即更新已有的推送,否则为注册新推送,更新推送仅仅在iOS10以上有效,结果通过request.completionHandler返回
|
|
||||||
* @discussion 旧的注册本地推送接口被废弃,使用此接口可以替换
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)addNotification:(JPushNotificationRequest *)request;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 移除推送 (支持iOS10,并兼容iOS10以下版本)
|
|
||||||
*
|
|
||||||
* JPush 2.1.9新接口
|
|
||||||
* @param identifier JPushNotificationIdentifier类型,iOS10以上identifier设置为nil,则移除所有在通知中心显示推送和待推送请求,也可以通过设置identifier.delivered和identifier.identifiers来移除相应在通知中心显示推送或待推送请求,identifier.identifiers如果设置为nil或空数组则移除相应标志下所有在通知中心显示推送或待推送请求;iOS10以下identifier设置为nil,则移除所有推送,identifier.delivered属性无效,另外可以通过identifier.notificationObj传入特定推送对象来移除此推送。
|
|
||||||
* @discussion 旧的所有删除推送接口被废弃,使用此接口可以替换
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)removeNotification:(JPushNotificationIdentifier *)identifier;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 查找推送 (支持iOS10,并兼容iOS10以下版本)
|
|
||||||
*
|
|
||||||
* JPush 2.1.9新接口
|
|
||||||
* @param identifier JPushNotificationIdentifier类型,iOS10以上可以通过设置identifier.delivered和identifier.identifiers来查找相应在通知中心显示推送或待推送请求,identifier.identifiers如果设置为nil或空数组则返回相应标志下所有在通知中心显示推送或待推送请求;iOS10以下identifier.delivered属性无效,identifier.identifiers如果设置nil或空数组则返回所有未触发的推送。须要设置identifier.findCompletionHandler回调才能得到查找结果,通过(NSArray *results)返回相应对象数组。
|
|
||||||
* @discussion 旧的查找推送接口被废弃,使用此接口可以替换
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)findNotification:(JPushNotificationIdentifier *)identifier;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 本地推送,最多支持64个
|
|
||||||
*
|
|
||||||
* @param fireDate 本地推送触发的时间
|
|
||||||
* @param alertBody 本地推送需要显示的内容
|
|
||||||
* @param badge 角标的数字。如果不需要改变角标传-1
|
|
||||||
* @param alertAction 弹框的按钮显示的内容(IOS 8默认为"打开", 其他默认为"启动")
|
|
||||||
* @param notificationKey 本地推送标示符
|
|
||||||
* @param userInfo 自定义参数,可以用来标识推送和增加附加信息
|
|
||||||
* @param soundName 自定义通知声音,设置为nil为默认声音
|
|
||||||
*
|
|
||||||
* @discussion 最多支持 64 个定义,此方法被[addNotification:]方法取代
|
|
||||||
*/
|
|
||||||
+ (UILocalNotification *)setLocalNotification:(NSDate *)fireDate
|
|
||||||
alertBody:(NSString *)alertBody
|
|
||||||
badge:(int)badge
|
|
||||||
alertAction:(NSString *)alertAction
|
|
||||||
identifierKey:(NSString *)notificationKey
|
|
||||||
userInfo:(NSDictionary *)userInfo
|
|
||||||
soundName:(NSString *)soundName __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 本地推送 (支持 iOS8 新参数)
|
|
||||||
*
|
|
||||||
* IOS8新参数
|
|
||||||
* @param region 自定义参数
|
|
||||||
* @param regionTriggersOnce 自定义参数
|
|
||||||
* @param category 自定义参数
|
|
||||||
* @discussion 此方法被[addNotification:]方法取代
|
|
||||||
*/
|
|
||||||
+ (UILocalNotification *)setLocalNotification:(NSDate *)fireDate
|
|
||||||
alertBody:(NSString *)alertBody
|
|
||||||
badge:(int)badge
|
|
||||||
alertAction:(NSString *)alertAction
|
|
||||||
identifierKey:(NSString *)notificationKey
|
|
||||||
userInfo:(NSDictionary *)userInfo
|
|
||||||
soundName:(NSString *)soundName
|
|
||||||
region:(CLRegion *)region
|
|
||||||
regionTriggersOnce:(BOOL)regionTriggersOnce
|
|
||||||
category:(NSString *)category NS_AVAILABLE_IOS(8_0) __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 前台展示本地推送
|
|
||||||
*
|
|
||||||
* @param notification 本地推送对象
|
|
||||||
* @param notificationKey 需要前台显示的本地推送通知的标示符
|
|
||||||
*
|
|
||||||
* @discussion 默认App在前台运行时不会进行弹窗,在程序接收通知调用此接口可实现指定的推送弹窗。--iOS10以下还可继续使用,iOS10以上在[UNUserNotificationCenterDelegate willPresentNotification:withCompletionHandler:]方法中调用completionHandler(UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert);即可
|
|
||||||
*/
|
|
||||||
+ (void)showLocalNotificationAtFront:(UILocalNotification *)notification
|
|
||||||
identifierKey:(NSString *)notificationKey __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
/*!
|
|
||||||
* @abstract 删除本地推送定义
|
|
||||||
*
|
|
||||||
* @param notificationKey 本地推送标示符
|
|
||||||
* @discussion 此方法被[removeNotification:]方法取代
|
|
||||||
*/
|
|
||||||
+ (void)deleteLocalNotificationWithIdentifierKey:(NSString *)notificationKey __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 删除本地推送定义
|
|
||||||
* @discussion 此方法被[removeNotification:]方法取代
|
|
||||||
*/
|
|
||||||
+ (void)deleteLocalNotification:(UILocalNotification *)localNotification __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 获取指定通知
|
|
||||||
*
|
|
||||||
* @param notificationKey 本地推送标示符
|
|
||||||
* @return 本地推送对象数组, [array count]为0时表示没找到
|
|
||||||
* @discussion 此方法被[findNotification:]方法取代
|
|
||||||
*/
|
|
||||||
+ (NSArray *)findLocalNotificationWithIdentifier:(NSString *)notificationKey __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 清除所有本地推送对象
|
|
||||||
* @discussion 此方法被[removeNotification:]方法取代
|
|
||||||
*/
|
|
||||||
+ (void)clearAllLocalNotifications __attribute__((deprecated("JPush 2.1.9 版本已过期")));
|
|
||||||
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Server badge 服务器端 badge 功能
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 设置角标(到服务器)
|
|
||||||
*
|
|
||||||
* @param value 新的值. 会覆盖服务器上保存的值(这个用户)
|
|
||||||
*
|
|
||||||
* @discussion 本接口不会改变应用本地的角标值.
|
|
||||||
* 本地仍须调用 UIApplication:setApplicationIconBadgeNumber 函数来设置脚标.
|
|
||||||
*
|
|
||||||
* 本接口用于配合 JPush 提供的服务器端角标功能.
|
|
||||||
* 该功能解决的问题是, 服务器端推送 APNs 时, 并不知道客户端原来已经存在的角标是多少, 指定一个固定的数字不太合理.
|
|
||||||
*
|
|
||||||
* JPush 服务器端脚标功能提供:
|
|
||||||
*
|
|
||||||
* - 通过本 API 把当前客户端(当前这个用户的) 的实际 badge 设置到服务器端保存起来;
|
|
||||||
* - 调用服务器端 API 发 APNs 时(通常这个调用是批量针对大量用户),
|
|
||||||
* 使用 "+1" 的语义, 来表达需要基于目标用户实际的 badge 值(保存的) +1 来下发通知时带上新的 badge 值;
|
|
||||||
*/
|
|
||||||
+ (BOOL)setBadge:(NSInteger)value;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 重置脚标(为0)
|
|
||||||
*
|
|
||||||
* @discussion 相当于 [setBadge:0] 的效果.
|
|
||||||
* 参考 [JPUSHService setBadge:] 说明来理解其作用.
|
|
||||||
*/
|
|
||||||
+ (void)resetBadge;
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Other Feature 其他功能
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 设置手机号码(到服务器)
|
|
||||||
*
|
|
||||||
* @param mobileNumber 手机号码. 会与用户信息一一对应。可为空,为空则清除号码
|
|
||||||
* @param completion 响应回调。成功则error为空,失败则error带有错误码及错误信息
|
|
||||||
*
|
|
||||||
* @discussion 设置手机号码后,可实现“推送不到短信到”的通知方式,提高推送达到率。结果信息通过completion异步返回,也可将completion设置为nil不处理结果信息。
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)setMobileNumber:(NSString *)mobileNumber completion:(void (^)(NSError *error))completion;
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Logs and others 日志与其他
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract JPush标识此设备的 registrationID
|
|
||||||
*
|
|
||||||
* @discussion SDK注册成功后, 调用此接口获取到 registrationID 才能够获取到.
|
|
||||||
*
|
|
||||||
* JPush 支持根据 registrationID 来进行推送.
|
|
||||||
* 如果你需要此功能, 应该通过此接口获取到 registrationID 后, 上报到你自己的服务器端, 并保存下来.
|
|
||||||
* registrationIDCompletionHandler:是新增的获取registrationID的方法,需要在block中获取registrationID,resCode为返回码,模拟器调用此接口resCode返回1011,registrationID返回nil.
|
|
||||||
* 更多的理解请参考 JPush 的文档网站.
|
|
||||||
*/
|
|
||||||
+ (NSString *)registrationID;
|
|
||||||
|
|
||||||
+ (void)registrationIDCompletionHandler:(void(^)(int resCode,NSString *registrationID))completionHandler;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 打开日志级别到 Debug
|
|
||||||
*
|
|
||||||
* @discussion JMessage iOS 的日志系统参考 Android 设计了级别.
|
|
||||||
* 从低到高是: Verbose, Debug, Info, Warning, Error.
|
|
||||||
* 对日志级别的进一步理解, 请参考 Android 相关的说明.
|
|
||||||
*
|
|
||||||
* SDK 默认开启的日志级别为: Info. 只显示必要的信息, 不打印调试日志.
|
|
||||||
*
|
|
||||||
* 请在SDK启动后调用本接口,调用本接口可打开日志级别为: Debug, 打印调试日志.
|
|
||||||
*/
|
|
||||||
+ (void)setDebugMode;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 关闭日志
|
|
||||||
*
|
|
||||||
* @discussion 关于日志级别的说明, 参考 [JPUSHService setDebugMode]
|
|
||||||
*
|
|
||||||
* 虽说是关闭日志, 但还是会打印 Warning, Error 日志. 这二种日志级别, 在程序运行正常时, 不应有打印输出.
|
|
||||||
*
|
|
||||||
* 建议在发布的版本里, 调用此接口, 关闭掉日志打印.
|
|
||||||
*/
|
|
||||||
+ (void)setLogOFF;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 设置SDK地理位置权限开关
|
|
||||||
*
|
|
||||||
* @discussion 关闭地理位置之后,SDK地理围栏的相关功能将受到影响,默认是开启。
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)setLocationEanable:(BOOL)isEanble;
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 设置应用内消息的代理
|
|
||||||
*
|
|
||||||
* @discussion 遵守JPushInMessageDelegate的代理对象
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)setInMessageDelegate:(id<JPushInMessageDelegate>)inMessageDelegate;
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @abstract 主动拉取应用内消息的接口
|
|
||||||
*
|
|
||||||
* @discussion 拉取结果的回调
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
+ (void)pullInMessageCompletion:(JPUSHInMssageCompletion)completion;
|
|
||||||
|
|
||||||
///----------------------------------------------------
|
|
||||||
///********************下列方法已过期********************
|
|
||||||
///**************请使用新版tag/alias操作接口**************
|
|
||||||
///----------------------------------------------------
|
|
||||||
/// @name Tag alias setting 设置别名与标签
|
|
||||||
///----------------------------------------------------
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* 下面的接口是可选的
|
|
||||||
* 设置标签和(或)别名(若参数为nil,则忽略;若是空对象,则清空;详情请参考文档:https://docs.jiguang.cn/jpush/client/iOS/ios_api/)
|
|
||||||
* setTags:alias:fetchCompletionHandle:是新的设置标签别名的方法,不再需要显示声明回调函数,只需要在block里面处理设置结果即可.
|
|
||||||
* WARN: 使用block时需要注意循环引用问题
|
|
||||||
*/
|
|
||||||
+ (void) setTags:(NSSet *)tags
|
|
||||||
alias:(NSString *)alias
|
|
||||||
callbackSelector:(SEL)cbSelector
|
|
||||||
target:(id)theTarget __attribute__((deprecated("JPush 2.1.1 版本已过期")));
|
|
||||||
+ (void) setTags:(NSSet *)tags
|
|
||||||
alias:(NSString *)alias
|
|
||||||
callbackSelector:(SEL)cbSelector
|
|
||||||
object:(id)theTarget __attribute__((deprecated("JPush 3.0.6 版本已过期")));
|
|
||||||
+ (void) setTags:(NSSet *)tags
|
|
||||||
callbackSelector:(SEL)cbSelector
|
|
||||||
object:(id)theTarget __attribute__((deprecated("JPush 3.0.6 版本已过期")));
|
|
||||||
+ (void)setTags:(NSSet *)tags
|
|
||||||
alias:(NSString *)alias
|
|
||||||
fetchCompletionHandle:(void (^)(int iResCode, NSSet *iTags, NSString *iAlias))completionHandler __attribute__((deprecated("JPush 3.0.6 版本已过期")));
|
|
||||||
+ (void) setTags:(NSSet *)tags
|
|
||||||
aliasInbackground:(NSString *)alias __attribute__((deprecated("JPush 3.0.6 版本已过期")));
|
|
||||||
+ (void)setAlias:(NSString *)alias
|
|
||||||
callbackSelector:(SEL)cbSelector
|
|
||||||
object:(id)theTarget __attribute__((deprecated("JPush 3.0.6 版本已过期")));
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@class UNUserNotificationCenter;
|
|
||||||
@class UNNotificationResponse;
|
|
||||||
|
|
||||||
@protocol JPUSHRegisterDelegate <NSObject>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @brief handle UserNotifications.framework [willPresentNotification:withCompletionHandler:]
|
|
||||||
* @param center [UNUserNotificationCenter currentNotificationCenter] 新特性用户通知中心
|
|
||||||
* @param notification 前台得到的的通知对象
|
|
||||||
* @param completionHandler 该callback中的options 请使用UNNotificationPresentationOptions
|
|
||||||
*/
|
|
||||||
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger options))completionHandler;
|
|
||||||
/*
|
|
||||||
* @brief handle UserNotifications.framework [didReceiveNotificationResponse:withCompletionHandler:]
|
|
||||||
* @param center [UNUserNotificationCenter currentNotificationCenter] 新特性用户通知中心
|
|
||||||
* @param response 通知响应对象
|
|
||||||
* @param completionHandler
|
|
||||||
*/
|
|
||||||
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @brief handle UserNotifications.framework [openSettingsForNotification:]
|
|
||||||
* @param center [UNUserNotificationCenter currentNotificationCenter] 新特性用户通知中心
|
|
||||||
* @param notification 当前管理的通知对象
|
|
||||||
*/
|
|
||||||
- (void)jpushNotificationCenter:(UNUserNotificationCenter *)center openSettingsForNotification:(UNNotification *)notification NS_AVAILABLE_IOS(12.0);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 监测通知授权状态返回的结果
|
|
||||||
* @param status 授权通知状态,详见JPAuthorizationStatus
|
|
||||||
* @param info 更多信息,预留参数
|
|
||||||
*/
|
|
||||||
- (void)jpushNotificationAuthorization:(JPAuthorizationStatus)status withInfo:(NSDictionary *)info;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol JPUSHGeofenceDelegate <NSObject>
|
|
||||||
|
|
||||||
/**
|
|
||||||
进入地理围栏区域
|
|
||||||
|
|
||||||
@param geofenceId 地理围栏id
|
|
||||||
@param userInfo 地理围栏触发时返回的信息
|
|
||||||
@param error 错误信息
|
|
||||||
*/
|
|
||||||
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didEnterRegion:(NSDictionary *)userInfo error:(NSError *)error;
|
|
||||||
|
|
||||||
/**
|
|
||||||
离开地理围栏区域
|
|
||||||
|
|
||||||
@param geofenceId 地理围栏id
|
|
||||||
@param userInfo 地理围栏触发时返回的信息
|
|
||||||
@param error 错误信息
|
|
||||||
*/
|
|
||||||
- (void)jpushGeofenceIdentifer:(NSString *)geofenceId didExitRegion:(NSDictionary *)userInfo error:(NSError *)error;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@protocol JPushInMessageDelegate <NSObject>
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
*是否允许应用内消息弹出,默认为允许
|
|
||||||
*/
|
|
||||||
- (BOOL)jPushInMessageIsAllowedInMessagePop;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*应用内消息展示的回调
|
|
||||||
*/
|
|
||||||
- (void)jPushInMessageAlreadyPop __attribute__((deprecated("JPush 3.4.0 版本已过期")));;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*应用内消息已消失
|
|
||||||
*/
|
|
||||||
- (void)jPushInMessageAlreadyDisappear;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
inMessage展示的回调
|
|
||||||
|
|
||||||
@param messageType inMessage
|
|
||||||
@param content 下发的数据,广告类的返回数据为空时返回的信息
|
|
||||||
|
|
||||||
*/
|
|
||||||
- (void)jPushInMessageAlreadyPopInMessageType:(JPushInMessageContentType)messageType Content:(NSDictionary *)content;
|
|
||||||
|
|
||||||
/**
|
|
||||||
inMessage点击的回调
|
|
||||||
|
|
||||||
@param messageType inMessage
|
|
||||||
@param content 下发的数据,广告类的返回数据为空时返回的信息
|
|
||||||
|
|
||||||
*/
|
|
||||||
- (void)jpushInMessagedidClickInMessageType:(JPushInMessageContentType)messageType Content:(NSDictionary *)content;
|
|
||||||
|
|
||||||
@end
|
|
@ -1,17 +0,0 @@
|
|||||||
//
|
|
||||||
// JPushModule.h
|
|
||||||
// UniPluginJPush
|
|
||||||
//
|
|
||||||
// Created by huangshuni on 2021/1/12.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import "DCUniModule.h"
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
|
||||||
|
|
||||||
@interface JPushModule : DCUniModule
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_END
|
|
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user