Commit d7b08afb authored by 000's avatar 000

Merge branch 'dev' into 'feature_recommend_q'

Dev

See merge request !5
parents 48225b9e 00685a0c
...@@ -122,7 +122,8 @@ ...@@ -122,7 +122,8 @@
console.log('这里') console.log('这里')
let res = await newsRemind({ let res = await newsRemind({
uid:this.$store.state.userInfo.user_id, uid:this.$store.state.userInfo.user_id,
cid:cid cid:cid,
}); });
if(res.code==0){ if(res.code==0){
......
<template>
<view class="date-time-picker" v-if="visible">
<view class="date-time-mask" @click.stop="hide"></view>
<view class="date-time-container" @click.stop="handleEvent">
<view class="time-picker-tool" v-if='isShowToolBar'>
<view :class="[cancelButtonClass]" @click.stop="cancel">
<text>{{cancelButtonText}}</text>
</view>
<view :class="[toolBarTitleClass]">
<text>{{toolBarTitle}}</text>
</view>
<view :class="[confirmButtonClass]" @click.stop="confirm">
<text>{{confirmButtonText}}</text>
</view>
</view>
<picker-view class="picker-view" :indicator-style="indicatorStyleString" :value="dateTime" @change="dateTimePickerChange">
<picker-view-column data-id='year' v-if='isShowYear'>
<view class="item" v-for="(item,index) in years" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column data-id='month' v-if='isShowMonth'>
<view class="item" v-for="(item,index) in months" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column data-id='day' v-if='isShowDay'>
<view class="item" v-for="(item,index) in days" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column data-id='hour' v-if='isShowHour'>
<view class="item" v-for="(item,index) in hours" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column data-id='minute' v-if='isShowMinute'>
<view class="item" v-for="(item,index) in minutes" :key="index">{{item}}</view>
</picker-view-column>
<picker-view-column data-id='second' v-if='isShowSecond'>
<view class="item" v-for="(item,index) in seconds" :key="index">{{item}}</view>
</picker-view-column>
</picker-view>
</view>
</view>
</template>
<script>
import {
getOneMonthDays,
getTimeArray,
addZero,
getIndexOfArray
} from './uitls/util.js'
export default {
name: 'DateTimePicker',
props: {
startYear: {
type: Number,
default: 1900
},
endYear: {
type: Number,
default: new Date().getFullYear()
},
isShowToolBar: {
type: Boolean,
default: true
},
cancelButtonText: {
type: String,
default: '取消'
},
cancelButtonClass: {
type: String,
default: 'cancel-btn'
},
toolBarTitle: {
type: String,
default: '请选择'
},
toolBarTitleClass: {
type: String,
default: 'tool-title'
},
confirmButtonText: {
type: String,
default: '确定'
},
confirmButtonClass: {
type: String,
default: 'confirm-btn'
},
datestring: {
type: String,
default: ''
},
type: {
/**
* date 年月日
* year-month 年月
* year 年
* datetime 年月日 时分
* datetime-all 年月日 时分秒
* time 时分秒
* hour-minute 时分
*/
type: String,
default: 'date'
},
indicatorStyle: {
type: Object,
default: null
}
},
data() {
return {
visible: false,
dateTime: [],
days: [],
indicatorStyleString: ''
}
},
watch: {
indicatorStyle(val){
this.getIndicatorStyle();
},
type() {
this.initDateTime()
},
datestring(){
this.initDateTime()
}
},
computed: {
years() {
return this.initTimeData(this.endYear, this.startYear);
},
isShowYear() {
return this.type !== 'time' && this.type !== 'hour-minute';
},
months() {
return this.initTimeData(12, 1);
},
isShowMonth() {
return this.type !== 'year' && this.type !== 'time' && this.type !== 'hour-minute';
},
isShowDay() {
return this.type === 'date' || this.type === 'datetime' || this.type === 'datetime-all';
},
hours() {
return this.initTimeData(23, 0);
},
isShowHour() {
return this.type !== 'date' && this.type !== 'year-month' && this.type !== 'year';
},
minutes() {
return this.initTimeData(59, 0);
},
isShowMinute() {
return this.type !== 'date' && this.type !== 'year-month' && this.type !== 'year';
},
seconds() {
return this.initTimeData(59, 0);
},
isShowSecond() {
return this.type === 'datetime-all' || this.type === 'time';
}
},
methods: {
getIndicatorStyle(){
if(this.indicatorStyle){
for(let key in this.indicatorStyle){
this.indicatorStyleString += `${key}:${this.indicatorStyle[key]};`
}
}
},
handleEvent() {
return;
},
cancel() {
this.hide();
},
confirm() {
this.formatDate();
this.hide();
},
show() {
this.visible = true;
},
hide() {
this.visible = false;
},
initDateTime() {
let value;
if (this.datestring.length > 0) {
if (this.type === 'year') {
value = new Date(this.datestring, 0);
} else if (this.type === 'time' || this.type === 'hour-minute') {
let date = new Date();
let ary = this.datestring.split(':');
ary.forEach((item, index) => {
if (index == 0) {
date.setHours(item)
} else if (index == 1) {
date.setMinutes(item)
} else if (index == 2) {
date.setSeconds(item)
}
})
value = date;
} else {
value = new Date(this.datestring.replace(/-/g, '/'));
}
} else {
value = new Date();
}
let len, timeArray, index;
let array = getTimeArray(value);
let [year, month, day, hour, minute, second] = array;
this.days = this.initTimeData(getOneMonthDays(year, month-1), 1);
let names = ['year', 'month', 'day', 'hour', 'minute', 'second'];
switch (this.type) {
case "date":
len = 3;
break;
case "year-month":
len = 2;
break;
case "year":
len = 1;
break;
case "datetime":
len = 5;
break;
case "datetime-all":
len = 6;
break;
case "time":
len = 3;
break;
case "hour-minute":
len = 2;
break;
}
timeArray = new Array(len).fill(0);
if (this.type === 'time' || this.type === 'hour-minute') {
names = names.slice(3);
array = array.slice(3);
}
timeArray = timeArray.map((item, index) => {
const name = names[index];
return getIndexOfArray(array[index], this[name + 's'])
})
this.dateTime = timeArray;
},
initTimeData(end, start) {
let timeArray = [];
while (start <= end) {
timeArray.push(start);
start++;
}
return timeArray;
},
formatDate() {
let names = ['year', 'month', 'day', 'hour', 'minute', 'second'];
let dateString, formatDateArray = [];
if (this.type === 'date' || this.type === 'year-month' || this.type === 'year') {
formatDateArray = this.dateTime.map((item, index) => {
return this[names[index] + 's'][item] < 10 ? addZero(this[names[index] + 's'][item]) : this[names[index] + 's'][item];
})
dateString = formatDateArray.join('-');
} else if (this.type === 'time' || this.type === 'hour-minute') {
names = names.splice(3);
formatDateArray = this.dateTime.map((item, index) => {
return this[names[index] + 's'][item] < 10 ? addZero(this[names[index] + 's'][item]) : this[names[index] + 's'][item];
})
dateString = formatDateArray.join(':');
} else {
let name1 = names.splice(0, 3);
formatDateArray = this.dateTime.map((item, index) => {
if (index > 2) {
return this[names[index - 3] + 's'][item] < 10 ? addZero(this[names[index - 3] + 's'][item]) : this[names[index - 3] + 's'][item];
} else {
return this[name1[index] + 's'][item] < 10 ? addZero(this[name1[index] + 's'][item]) : this[name1[index] + 's'][item];
}
})
dateString = formatDateArray.splice(0, 3).join('-') + ' ' + formatDateArray.join(':');
}
this.$emit('change', dateString)
},
dateTimePickerChange(e) {
let columns = e.target.value;
if (this.type === 'date' || this.type === 'datetime' || this.type === 'datetime-all') {
this.dateTime.splice(0, 1, columns[0]);
if (columns[0] != this.dateTime[0]) {
this.days = this.initTimeData(getOneMonthDays(this.years[this.dateTime[0]], this.months[this.dateTime[1]]), 1);
if (this.dateTime[1] == 1) {
if (this.dateTime[2] === this.days.length - 1) {
if (getOneMonthDays(this.years[columns[0]], this.dateTime[1]) < getOneMonthDays(this.years[this.dateTime[0]],this.dateTime[1])) {
this.dateTime.splice(2, 1, this.days.length - 1)
}
}
}
} else {
this.dateTime.splice(1, 1, columns[1]);
this.days = this.initTimeData(getOneMonthDays(this.years[this.dateTime[0]], this.dateTime[1]), 1);
if (columns[1] != this.dateTime[1]) {
if (this.dateTime[1] == 1) {
if (this.dateTime[2] === this.days.length - 1) {
if (getOneMonthDays(this.years[columns[0]], this.dateTime[1]) < getOneMonthDays(this.years[this.dateTime[0]],
this.dateTime[1])) {
this.dateTime.splice(2, 1, this.days.length - 1)
}
}
} else {
if (this.dateTime[2] > this.days.length - 1) {
this.dateTime.splice(2, 1, this.days.length - 1)
} else {
this.dateTime.splice(2, 1, columns[2])
}
}
} else {
this.dateTime.splice(2, 1, columns[2])
}
}
if (columns.length > 2) {
columns.splice(3).forEach((column, index) => {
this.dateTime.splice(index + 3, 1, column);
})
}
} else {
columns.forEach((column, index) => {
this.dateTime.splice(index, 1, column);
})
}
if (!this.isShowToolBar) {
this.formatDate();
}
},
},
mounted() {
this.getIndicatorStyle();
this.initDateTime();
}
}
</script>
<style lang='scss' scoped>
.date-time-picker {
.date-time-mask {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba($color: #000000, $alpha: .5);
z-index: 998;
}
.date-time-container {
position: fixed;
height: 50%;
bottom: 0;
right: 0;
left: 0;
background-color: #f6f6f6;
z-index: 1000;
display: flex;
flex-direction: column;
.time-picker-tool {
height: 80rpx;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
.cancel-btn {
padding: 0 28rpx;
box-sizing: border-box;
color: #969799;
}
.tool-title {
font-weight: 500;
font-size: 16px;
max-width: 50%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.confirm-btn {
padding: 0 28rpx;
box-sizing: border-box;
color: #576b95;
}
}
.picker-view {
width: 100%;
flex: 1;
.item {
font-size: 34rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
}
}
</style>
/**
* 获取某年某月有多少天
*/
export const getOneMonthDays = (year,month)=>{
month = Number(month);
const baseMonthsDays = [31,28,31,30,31,30,31,31,30,31,30,31];
if(year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)){
if(month === 1){
baseMonthsDays[month] = 29;
}
}
return baseMonthsDays[month];
}
/**
* 获取日期的年月日时分秒
*/
export const getTimeArray = (date)=>{
const year = date.getFullYear();
const month = date.getMonth()+1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
return [year,month,day,hour,minute,second];
}
/**
* 小于10的数字前面补0
*/
export const addZero = (num)=>{
return num < 10 ? '0' + num : num;
}
/**
* 获取当前值在数组中的索引
*/
export const getIndexOfArray = (value,array)=>{
let index = array.findIndex(item => item == value);
return index > -1 ? index : 0;
}
\ No newline at end of file
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
//"appid" : "__UNI__FC9419E", //"appid" : "__UNI__FC9419E",
"appid" : "__UNI__1EA80F1", //这个是 web "appid" : "__UNI__1EA80F1", //这个是 web
"description" : "商家", "description" : "商家",
"versionName" : "1.0.96", "versionName" : "1.0.99",
"versionCode" : 196, "versionCode" : 199,
"transformPx" : false, "transformPx" : false,
"compatible" : { "compatible" : {
"ignoreVersion" : true, //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 "ignoreVersion" : true, //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
"runtimeVersion" : "2.9.7,2.9.8", //兼容的uni-app运行环境版本号,多个版本使用,分割 "runtimeVersion" : "2.9.3,2.9.7,2.9.8", //兼容的uni-app运行环境版本号,多个版本使用,分割
"compilerVersion" : "2.9.8" //兼容的编译器版本号 "compilerVersion" : "2.9.8" //兼容的编译器版本号
}, },
/* 5+App特有相关weex */ /* 5+App特有相关weex */
......
...@@ -395,7 +395,58 @@ ...@@ -395,7 +395,58 @@
"navigationBarTitleText": "物流发货", "navigationBarTitleText": "物流发货",
"navigationBarBackgroundColor":"#FFFFFF" "navigationBarBackgroundColor":"#FFFFFF"
} }
} },{
"path":"pages/publishActivities/activityList/activityList",
"style" : {
//机型列表
"navigationBarTitleText": "活动列表",
"navigationBarBackgroundColor":"#FFFFFF",
"enablePullDownRefresh":true
}
},{
"path":"pages/publishActivities/publishActivity/publishActivity",
"style" : {
//机型列表 activityDetail
"navigationBarTitleText": "发布免费活动",
"navigationBarBackgroundColor":"#FFFFFF"
}
},{
"path":"pages/publishActivities/activityDetail/activityDetail",
"style" : {
//机型列表 activityDetail
"navigationBarTitleText": "活动详情",
"navigationBarBackgroundColor":"#FFFFFF",
"enablePullDownRefresh":true
}
},{
"path" : "pages/order/shoprefundorderdetail/shoprefundorderdetail",
"style" :
{
"navigationBarTitleText": "商城售后订单详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/order/shopExamine/shopExamine",
"style" :
{
"navigationBarTitleText": "订单退款",
"enablePullDownRefresh": false
}
}
,{
"path" : "pages/order/ExamineDelivery/ExamineDelivery",
"style" :
{
"navigationBarTitleText": "立即发货",
"enablePullDownRefresh": false
}
}
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
......
<template> <template>
<!-- yocode 物流信息 --> <!-- yocode 物流信息 -->
<view class="content ViewLogistics yocode"> <view class="content ViewLogistics yocode">
<!-- 地图呀 --> <!-- 地图呀 -->
<!-- <view class="page-body"> <!-- <view class="page-body">
<view class="page-section page-section-gap"> <view class="page-section page-section-gap">
...@@ -9,66 +8,66 @@ ...@@ -9,66 +8,66 @@
</map> </map>
</view> </view>
</view> --> </view> -->
<view class="wuliuboxss flex ali-c"> <view class="wuliuboxss flex ali-c">
<image class="imgs" :src="statictowUrl+'/static/applet5'+logisticLogo" mode=""></image> <image class="imgs" :src="statictowUrl + '/static/applet5' + logisticLogo" mode=""></image>
<view class="rightinfos"> <view class="rightinfos">
<view class="wuliutype">{{shipperName}}</view> <view class="wuliutype">{{ shipperName }}</view>
<view class="wuliucode">运单号: {{logisticCode}}</view> <view class="wuliucode">运单号: {{ logisticCode }}</view>
<view class="wuliutel">官方电话: {{phone}}</view> <view class="wuliutel">官方电话: {{ phone }}</view>
</view> </view>
</view> </view>
<!-- 查看物流的组件 alidata2.state --> <!-- 查看物流的组件 alidata2.state -->
<ali :state="3" :datas="list" :ways="information"></ali> <ali :state="3" :datas="list" :ways="information"></ali>
</view> </view>
</template> </template>
<script> <script>
import ali from '@/components/WuLiu-step/WuLiu-step.vue'; import ali from '@/components/WuLiu-step/WuLiu-step.vue';
import {checkLogistics} from "@/utils/api/api.js"; import { checkLogistics,viewLogistics} from '@/utils/api/api.js';
export default { export default {
components: { components: {
ali ali
}, },
computed: { computed: {
staticUrl () {//静态资源地址 staticUrl() {
//静态资源地址
return this.$store.state.staticUrl; return this.$store.state.staticUrl;
}, },
staticUrl1(){ staticUrl1() {
return this.$store.state.staticUrl1; return this.$store.state.staticUrl1;
}, },
statictowUrl(){ statictowUrl() {
return this.$store.state.statictowUrl; return this.$store.state.statictowUrl;
}, },
uploadurl(){ uploadurl() {
return this.$store.state.uploadurl; return this.$store.state.uploadurl;
} }
}, },
data() { data() {
return { return {
//地图的东西 //地图的东西
title: 'map', title: 'map',
latitude: 39.909, latitude: 39.909,
longitude: 116.39742, longitude: 116.39742,
covers: [{ covers: [
latitude: 39.909, {
longitude: 116.39742, latitude: 39.909,
iconPath: '/static/news/address.png' longitude: 116.39742,
}, { iconPath: '/static/news/address.png'
latitude: 39.90, },
longitude: 116.39, {
iconPath: '/static/news/address.png' latitude: 39.9,
}], longitude: 116.39,
iconPath: '/static/news/address.png'
}
],
alidata: { alidata: {
state: 2, state: 2,
uptime: '2019-05-23 17:52:06', uptime: '2019-05-23 17:52:06',
data: [ data: [],
],
information: { information: {
no: '231880744913', no: '231880744913',
sName: 'SF', sName: 'SF',
...@@ -81,9 +80,7 @@ export default { ...@@ -81,9 +80,7 @@ export default {
alidata2: { alidata2: {
state: 3, state: 3,
uptime: '2019-05-24 10:58:24', uptime: '2019-05-24 10:58:24',
data: [ data: [],
],
information: { information: {
no: '70939995911523', no: '70939995911523',
sName: 'HTKY', sName: 'HTKY',
...@@ -93,12 +90,12 @@ export default { ...@@ -93,12 +90,12 @@ export default {
img: 'https:oss-cn2.apistore.cnexpHTKY.png' img: 'https:oss-cn2.apistore.cnexpHTKY.png'
} }
}, },
list: [], list: [],
logisticCode: "", logisticCode: '',
shipperName: "", shipperName: '',
logisticLogo: "", logisticLogo: '',
phone: "", phone: '',
information: { information: {
no: '', no: '',
sName: '', sName: '',
...@@ -110,71 +107,89 @@ export default { ...@@ -110,71 +107,89 @@ export default {
}; };
}, },
onLoad(options) { onLoad(options) {
// console.log(options)
this.init(); this.init();
var that = this; var that = this;
console.log(options); // 判断为正常订单
let params = { if (options.order_id) {
order_id: options.order_id, let params = {
action: options.action, order_id: options.order_id,
vendor_id:options.vendor, action: options.action,
}; vendor_id: options.vendor
checkLogistics(params).then(res => { };
console.log(res); checkLogistics(params).then(res => {
if (res.code == 0) { console.log(res);
let data = res.data; if (res.code == 0) {
let list = this.checkArray(data.Traces) ? data.Traces : []; let data = res.data;
let logistics_info = this.getLogisticsConfig(data.ShipperCode) let list = this.checkArray(data.Traces) ? data.Traces : [];
let logistics_info = this.getLogisticsConfig(data.ShipperCode);
this.list=list.reverse();
this.logisticCode=data.LogisticCode; this.list = list.reverse();
this.shipperName=logistics_info.name; this.logisticCode = data.LogisticCode;
this.logisticLogo= logistics_info.img_url; this.shipperName = logistics_info.name;
this.phone=logistics_info.phone; this.logisticLogo = logistics_info.img_url;
this.phone = logistics_info.phone;
} }
}) });
// 如果为售后订单
} else if (options.refund_id) {
let refundParams = {
refund_id: options.refund_id,
type: 2
};
viewLogistics(refundParams).then(res => {
console.log(res)
if (res.code == 0) {
this.list = res.data.list;
let logistics_info = this.getLogisticsConfig(res.data.shipperCode);
this.list.reverse();
this.logisticCode = res.data.logisticCode;
this.shipperName = logistics_info.name;
this.logisticLogo = logistics_info.img_url;
this.phone = logistics_info.phone;
}
});
}
}, },
methods: { methods: {
init() { init() {},
},
/** /**
* 获取快递公司信息 * 获取快递公司信息
*/ */
getLogisticsConfig(shipperCode) { getLogisticsConfig(shipperCode) {
let config = { let config = {
'YTO': { 'name': '圆通速递', 'phone': '95554', 'img_url': '/images/delivery_icon/YTO.png' }, YTO: { name: '圆通速递', phone: '95554', img_url: '/images/delivery_icon/YTO.png' },
'HTKY': { 'name': '百世快递', 'phone': '95320', 'img_url': '/images/delivery_icon/HTKY.png' }, HTKY: { name: '百世快递', phone: '95320', img_url: '/images/delivery_icon/HTKY.png' },
'ZTO': { 'name': '中通快递', 'phone': '95311', 'img_url': '/images/delivery_icon/ZTO.png' }, ZTO: { name: '中通快递', phone: '95311', img_url: '/images/delivery_icon/ZTO.png' },
'STO': { 'name': '申通快递', 'phone': '95543', 'img_url': '/images/delivery_icon/STO.png' }, STO: { name: '申通快递', phone: '95543', img_url: '/images/delivery_icon/STO.png' },
'SF': { 'name': '顺丰速运', 'phone': '95338', 'img_url': '/images/delivery_icon/SF.png' }, SF: { name: '顺丰速运', phone: '95338', img_url: '/images/delivery_icon/SF.png' },
'YD': { 'name': '韵达速递', 'phone': '95546', 'img_url': '/images/delivery_icon/YD.png' }, YD: { name: '韵达速递', phone: '95546', img_url: '/images/delivery_icon/YD.png' },
'YZPY': { 'name': '邮政快递包裹', 'phone': '11185', 'img_url': '/images/delivery_icon/EMS.png' }, YZPY: { name: '邮政快递包裹', phone: '11185', img_url: '/images/delivery_icon/EMS.png' },
'EMS': { 'name': 'EMS', 'phone': '11183', 'img_url': '/images/delivery_icon/EMS.png' }, EMS: { name: 'EMS', phone: '11183', img_url: '/images/delivery_icon/EMS.png' },
'HHTT': { 'name': '天天快递', 'phone': '400-188-8888', 'img_url': '/images/delivery_icon/HHTT.png' }, HHTT: { name: '天天快递', phone: '400-188-8888', img_url: '/images/delivery_icon/HHTT.png' },
'JD': { 'name': '京东快递', 'phone': '950616', 'img_url': '/images/delivery_icon/JD.png' }, JD: { name: '京东快递', phone: '950616', img_url: '/images/delivery_icon/JD.png' },
'UC': { 'name': '优速快递', 'phone': '95349', 'img_url': '/images/qishou@2x.png' }, UC: { name: '优速快递', phone: '95349', img_url: '/images/qishou@2x.png' },
'DBL': { 'name': '德邦快递', 'phone': '95353', 'img_url': '/images/delivery_icon/DBL.png' }, DBL: { name: '德邦快递', phone: '95353', img_url: '/images/delivery_icon/DBL.png' },
'ZJS': { 'name': '宅急送', 'phone': '400-678-9000', 'img_url': '/images/qishou@2x.png' }, ZJS: { name: '宅急送', phone: '400-678-9000', img_url: '/images/qishou@2x.png' },
'TNT': { 'name': 'TNT快递', 'phone': '400-820-9868', 'img_url': '/images/qishou@2x.png' }, TNT: { name: 'TNT快递', phone: '400-820-9868', img_url: '/images/qishou@2x.png' },
'UPS': { 'name': 'UPS', 'phone': '400-820-8388', 'img_url': '/images/qishou@2x.png' }, UPS: { name: 'UPS', phone: '400-820-8388', img_url: '/images/qishou@2x.png' },
'DHL': { 'name': 'DHL', 'phone': '95380', 'img_url': '/images/qishou@2x.png' }, DHL: { name: 'DHL', phone: '95380', img_url: '/images/qishou@2x.png' },
'FEDEX': { 'name': 'FEDEX联邦(国内件)', 'phone': '400-886-1888', 'img_url': '/images/qishou@2x.png' }, FEDEX: { name: 'FEDEX联邦(国内件)', phone: '400-886-1888', img_url: '/images/qishou@2x.png' },
'FEDEX_GJ': { 'name': 'FEDEX联邦(国际件)', 'phone': '400-886-1888', 'img_url': '/images/qishou@2x.png' }, FEDEX_GJ: { name: 'FEDEX联邦(国际件)', phone: '400-886-1888', img_url: '/images/qishou@2x.png' }
} };
return config[shipperCode] || {}; return config[shipperCode] || {};
}, },
checkArray (obj) { checkArray(obj) {
if (obj != undefined && obj != null && obj[0] != undefined) { if (obj != undefined && obj != null && obj[0] != undefined) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./ViewLogistics.scss"; @import './ViewLogistics.scss';
</style> </style>
...@@ -158,7 +158,6 @@ ...@@ -158,7 +158,6 @@
<view class="inputbox flex"> <view class="inputbox flex">
<picker mode="date" fields="day" :value="form.manufacture_date" @change="bindDateChange"> <picker mode="date" fields="day" :value="form.manufacture_date" @change="bindDateChange">
<input disabled="true" class="input flex1" type="text" v-model="form.manufacture_date" value="" placeholder-class="plclass" placeholder="请填写生产日期" /> <input disabled="true" class="input flex1" type="text" v-model="form.manufacture_date" value="" placeholder-class="plclass" placeholder="请填写生产日期" />
<!-- <view class="uni-input">{{date}}</view> -->
</picker> </picker>
</view> </view>
</view> </view>
...@@ -391,44 +390,40 @@ ...@@ -391,44 +390,40 @@
checked:'2' checked:'2'
}], }],
ischeckedtime:[0],//默认选中, ischeckedtime:[0],//默认选中,
myProps: {
label: 'cate_name',
value: 'cate_id',
},
name: 'product', name: 'product',
result:[], result:[],
form: { form: {
// mandatory:'2', mandatory:'2',
// linkage_id:'', linkage_id:'',
// //cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名 //cost_price 成本价 stock 商品库存purchase 进货价钱code 条形编码commission 返佣比例original_name 原始商品名
// specifications:'',//商品规格 specifications:'',//商品规格
// stock:'', //商品库存 stock:'', //商品库存
// cost_price:'', //进货价钱 cost_price:'', //进货价钱
// code:'' ,//条形编码 code:'' ,//条形编码
// commission:'', //返佣比例 commission:'', //返佣比例
// sell_type:0,// 售卖类型 sell_type:0,// 售卖类型
// commodity_data:{}, //原始商品名 commodity_data:{}, //原始商品名
// quality_guarantee_period:0, //保质期(月) quality_guarantee_period:0, //保质期(月)
// manufacture_date:'' , //生产日期 manufacture_date:'' , //生产日期
// manufacturer :'', ///生产厂商 manufacturer :'', ///生产厂商
// brand :'', // 品牌 brand :'', // 品牌
// checkbox: [],//断选 checkbox: [],//断选
// product_id:"",//修改的时候的产品id product_id:"",//修改的时候的产品id
// product_name:"",//产品名称 product_name:"",//产品名称
// desc:"",//产品描述 desc:"",//产品描述
// cate_id:"",//产品分类id cate_id:"",//产品分类id
// photo:"",//产品图片 photo:"",//产品图片
// lunch_box_fee:'',//餐盒费 lunch_box_fee:'',//餐盒费
// is_new:"",//是否新产品 is_new:"",//是否新产品
// is_hot:"",//是否热卖产品 is_hot:"",//是否热卖产品
// action:"add",// 方式(添加:add,修改:edit) action:"add",// 方式(添加:add,修改:edit)
// price:"",//价格 price:"",//价格
// activity_price:"",//秒杀价 activity_price:"",//秒杀价
// store_count:"" ,// 秒杀库存 store_count:"" ,// 秒杀库存
// is_seckill:"0",//0 1 是否秒杀产品 is_seckill:"0",//0 1 是否秒杀产品
// activity_id:'0',//秒杀activity_id activity_id:'0',//秒杀activity_id
// activity_list:'',//秒杀列表 activity_list:'',//秒杀列表
// limit_num:"0" //秒杀限购数量 0 不限制 limit_num:"0" //秒杀限购数量 0 不限制
}, },
timeList:[ timeList:[
{} {}
...@@ -453,13 +448,16 @@ ...@@ -453,13 +448,16 @@
activity_type:"",//判断是否可以秒杀 activity_type:"",//判断是否可以秒杀
seckilltimelist:[],//秒杀时段列表 seckilltimelist:[],//秒杀时段列表
selchildList:[], selchildList:[],
cate_name:"",
index:0, index:0,
isScanCode:true,//是不是点击了扫码 isScanCode:true,//是不是点击了扫码
codeDisabled:false,//条形码是否能输入 codeDisabled:false,//条形码是否能输入
update:true, update:true,
detail_photos:[],//详情图片 detail_photos:[],//详情图片
video_photos:[],//轮播图片 video_photos:[],//轮播图片
cate_name:"", //分类名
} }
}, },
computed: { computed: {
...@@ -766,8 +764,15 @@ ...@@ -766,8 +764,15 @@
let res = await eleProductInfo({ let res = await eleProductInfo({
product_id:this.product_id, product_id:this.product_id,
}); });
console.log(res,'法大师傅大师傅大师傅士大夫大师傅');
if(res.code==0){ if(res.code==0){
this.form.cate_id = res.data.cate_id;//分类id
for(var i = 0; i < this.chindformList.length; i++) {
if(this.chindformList[i].cate_id==res.data.cate_id){
this.cate_name=this.chindformList[i].cate_name;
break;
}
}
this.linkage_product_id = res.data.linkage_product_id this.linkage_product_id = res.data.linkage_product_id
this.bools = res.data.product_name; this.bools = res.data.product_name;
this.defaultinfo = res.data; this.defaultinfo = res.data;
...@@ -778,7 +783,7 @@ ...@@ -778,7 +783,7 @@
this.form.photo = res.data.photo;//图片 this.form.photo = res.data.photo;//图片
this.form.activity_price = res.data.activity_price //秒杀价 this.form.activity_price = res.data.activity_price //秒杀价
this.form.store_count = res.data.store_count //秒杀库存 this.form.store_count = res.data.store_count //秒杀库存
this.form.cate_id = res.data.cate_id;//分类id
this.form.activity_id = res.data.activity_id//秒杀时段id this.form.activity_id = res.data.activity_id//秒杀时段id
this.form.limit_num = res.data.limit_num this.form.limit_num = res.data.limit_num
this.form.specifications = res.data.gram this.form.specifications = res.data.gram
...@@ -837,7 +842,6 @@ ...@@ -837,7 +842,6 @@
}else{ }else{
this.classValue = ''; this.classValue = '';
} }
//属性选默认值 //属性选默认值
if(res.data.is_new==1){ if(res.data.is_new==1){
...@@ -876,16 +880,18 @@ ...@@ -876,16 +880,18 @@
} }
}, },
getForm() { getForm() {
if(this.isshowsetkilltime && (this.form.activity_price==""||this.form.store_count==""||this.form.limit_num=="") ){ // if(this.isshowsetkilltime && (this.form.activity_price==""||this.form.store_count==""||this.form.limit_num=="") ){
this.$api.msg("请填写完整秒杀数据"); // this.$api.msg("请填写完整秒杀数据");
return false; // return false;
} // }
if(!this.isInteger(this.form.limit_num) || !this.isInteger(this.form.store_count)){
this.$api.msg("秒杀库存或限购数量不能为小数");
return false;
}
// console.log(this.form.limit_num,this.form.store_count)
// if(!this.isInteger(this.form.limit_num) || !this.isInteger(this.form.store_count)){
// this.$api.msg("秒杀库存或限购数量不能为小数");
// return false;
// }
let can = { let can = {
action:this.product_id==''?'add':'edit',
linkage_id:this.linkage_id, linkage_id:this.linkage_id,
mandatory:this.form.mandatory, mandatory:this.form.mandatory,
gram:this.form.specifications, //商品规格 gram:this.form.specifications, //商品规格
...@@ -902,7 +908,6 @@ ...@@ -902,7 +908,6 @@
product_name:this.form.product_name,//产品名称 product_name:this.form.product_name,//产品名称
desc:this.form.desc,//产品描述 desc:this.form.desc,//产品描述
lunch_box_fee:this.form.lunch_box_fee,//餐盒费 lunch_box_fee:this.form.lunch_box_fee,//餐盒费
action:this.form.action,//方式(添加:add,修改:edit)
price:this.form.price,//价格 price:this.form.price,//价格
photo: this.c_pics.length == 0?'': this.c_pics[0].data, //图片 photo: this.c_pics.length == 0?'': this.c_pics[0].data, //图片
activity_price:this.form.activity_price,//秒杀价 activity_price:this.form.activity_price,//秒杀价
...@@ -912,6 +917,7 @@ ...@@ -912,6 +917,7 @@
limit_num:this.form.limit_num ,//秒杀限购数量 limit_num:this.form.limit_num ,//秒杀限购数量
detail_photos:this.detail_photos,//详情图 detail_photos:this.detail_photos,//详情图
video_photos:this.video_photos,//轮播图 video_photos:this.video_photos,//轮播图
cate_id:this.form.cate_id,
}; };
...@@ -941,11 +947,11 @@ ...@@ -941,11 +947,11 @@
can.is_hot = 0; can.is_hot = 0;
} }
if(this.product_id!="" && this.is_datashow !=false ){ if(this.product_id!="" && this.is_datashow !=false ){
can.action = "edit";
can.product_id = this.product_id; can.product_id = this.product_id;
} }
//添加修改外卖产品 //添加修改外卖产品
addEditEleProduct(can).then((res1)=>{ addEditEleProduct(can).then((res1)=>{
console.log(res1,'成功了');
if(res1.code==0){ if(res1.code==0){
this.$api.msg(res1.msg); this.$api.msg(res1.msg);
setTimeout(()=>{ setTimeout(()=>{
...@@ -954,6 +960,8 @@ ...@@ -954,6 +960,8 @@
}else{ }else{
this.$api.msg(res1.msg); this.$api.msg(res1.msg);
} }
}).catch(err=>{
console.log(err,'失败了');
}) })
}, },
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<!-- <navigator url="/pages/edit/pro_manage/pro_manage"> --> <!-- <navigator url="/pages/edit/pro_manage/pro_manage"> -->
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/icon/20.png" mode=""></image> <image class="img" src="/static/icon/spgl.png" mode=""></image>
</view> </view>
<view>商品管理</view> <view>商品管理</view>
</view> </view>
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<navigator url="/pages/storeCategory/storeCategory?type=1"> <navigator url="/pages/storeCategory/storeCategory?type=1">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/icon/6.png" mode=""></image> <image class="img" src="/static/icon/eleclass.png" mode=""></image>
</view> </view>
<view>商品分类</view> <view>商品分类</view>
</view> </view>
...@@ -186,12 +186,12 @@ ...@@ -186,12 +186,12 @@
</navigator> </navigator>
</view> </view>
<view class="jiu_max" v-if="shop_type == 'goods'"> <view class="jiu_max" v-if="shop_type == 'goods'">
<!-- 商城订单 --> <!-- 商城订单 -->
<navigator url="/pages/order/shopOrder"> <navigator url="/pages/order/shopOrder">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/icon/8.png" mode=""></image> <image class="img" src="/static/icon/eleguanli.png" mode=""></image>
</view> </view>
<view>订单管理</view> <view>订单管理</view>
</view> </view>
...@@ -204,7 +204,7 @@ ...@@ -204,7 +204,7 @@
<navigator url="/pages/hotelOrder/hotelOrder"> <navigator url="/pages/hotelOrder/hotelOrder">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/icon/8.png" mode=""></image> <image class="img" src="/static/icon/eleguanli.png" mode=""></image>
</view> </view>
<view>订单管理</view> <view>订单管理</view>
</view> </view>
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
<navigator url="/pages/LuckDraw/homenav/homenav"> <navigator url="/pages/LuckDraw/homenav/homenav">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/news/liwuiocn.png" mode=""></image> <image class="img" src="/static/icon/liwuiocn.png" mode=""></image>
</view> </view>
<view>抽奖活动</view> <view>抽奖活动</view>
</view> </view>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</navigator> </navigator>
</view> </view>
<view class="jiu_max "> <view class="jiu_max " v-if="shop_type == 'ele'">
<navigator url="/pages/Printer/AddPrinter"> <navigator url="/pages/Printer/AddPrinter">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</navigator> </navigator>
</view> </view>
<view class="jiu_max " @tap="shops"> <view class="jiu_max " @tap="shops" v-if="shop_type == 'ele'">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/news/turntable.png" mode=""></image> <image class="img" src="/static/news/turntable.png" mode=""></image>
...@@ -265,7 +265,7 @@ ...@@ -265,7 +265,7 @@
</view> </view>
</view> </view>
<view class="jiu_max "> <view class="jiu_max " v-if="shop_type == 'ele'">
<navigator url="/pages/deliveryCost/deliveryCost"> <navigator url="/pages/deliveryCost/deliveryCost">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
...@@ -276,42 +276,55 @@ ...@@ -276,42 +276,55 @@
</navigator> </navigator>
</view> </view>
<!-- hgService.showSafeSetting(); --> <!-- hgService.showSafeSetting(); -->
<view class="jiu_max " v-if="is_bld"> <view class="jiu_max " v-if="shop_type == 'ele'&&is_bld">
<navigator url="/pages/eleProduct/eleProduct?edit=1"> <navigator url="/pages/eleProduct/eleProduct?edit=1">
<view class="jiu_min"> <view class="jiu_min">
<view> <view>
<image class="img" src="/static/icon/editPrice.png" mode=""></image> <image class="img" src="/static/icon/editPrice.png" mode=""></image>
</view>
<view>快捷改价</view>
</view> </view>
</navigator> <view>快捷改价</view>
</view> </view>
</navigator>
<view class="jiu_max " v-if="is_bld"> </view>
<navigator url="/pages/eleProduct/eleProduct?edit=2">
<view class="jiu_min"> <view class="jiu_max " v-if="shop_type == 'ele'&&is_bld">
<view> <navigator url="/pages/eleProduct/eleProduct?edit=2">
<image class="img" src="/static/icon/editStore.png" mode=""></image> <view class="jiu_min">
</view> <view>
<view>增减库存</view> <image class="img" src="/static/icon/editStore.png" mode=""></image>
</view> </view>
</navigator> <view>增减库存</view>
</view> </view>
</navigator>
</view>
<view class="jiu_max " @click="download" v-if="is_bld">
<view>
<view class="jiu_min"> <view class="jiu_max " @click="download" v-if="shop_type == 'ele'&&is_bld">
<view> <view>
<image class="img" src="/static/icon/download.png" mode=""></image> <view class="jiu_min">
</view> <view>
<view>下载称重商品</view> <image class="img" src="/static/icon/download.png" mode=""></image>
</view> </view>
<view>下载称重商品</view>
</view> </view>
</view> </view>
</view>
<!-- url="/pages/publishActivities/activityList/activityList" -->
<view class="jiu_max " v-if="shop_type == 'ele'">
<navigator url="/pages/publishActivities/activityList/activityList">
<view class="jiu_min">
<view>
<image class="img" src="/static/icon/0yuan.png" mode=""></image>
</view>
<view>0元领活动</view>
</view>
</navigator>
</view>
</view> </view>
<view class="BH"></view> <view class="BH"></view>
<Welcome ref="Welcome"></Welcome> <Welcome ref="Welcome"></Welcome>
<!-- 欢迎回来 --> <!-- 欢迎回来 -->
...@@ -320,7 +333,8 @@ ...@@ -320,7 +333,8 @@
<script> <script>
import { import {
getskipShop getskipShop,
activity_nucleus
} from "@/utils/api/merchant.js"; } from "@/utils/api/merchant.js";
import uniBadge from "@/components/uni/uni-badge/uni-badge.vue" import uniBadge from "@/components/uni/uni-badge/uni-badge.vue"
import uniIcon from "@/components/uni/uni-icon/uni-icon.vue" import uniIcon from "@/components/uni/uni-icon/uni-icon.vue"
...@@ -419,46 +433,85 @@ ...@@ -419,46 +433,85 @@
saoma(e) { saoma(e) {
uni.scanCode({ uni.scanCode({
success: res => { success: res => {
uni.request({ if (res.scanType == 'QR_CODE') {
url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。 let param = this.GetRequest(res.result);
data: { param.shop_id = this.shop_id
barcode: res.result,
needImg: true, activity_nucleus(param).then(res => {
app_id: 'qkkbptetyohxoiod', if (res.code == 0) {
app_secret: 'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09' this.$api.msg(res.msg);
}, }else{
method: 'GET', this.$api.msg(res.msg);
success: (results) => { }
console.log(results); })
if (results.data.code == 0) { return;
// this.$api.msg(results.data.msg); } else if (res.scanType == 'EAN_13') {
results.isScanCode = false; uni.request({
results.code = res.result; url: 'https://www.mxnzp.com/api/barcode/goods/details', //仅为示例,并非真实接口地址。
uni.navigateTo({ data: {
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results) barcode: res.result,
}) needImg: true,
} else if (results.data.code == 1) { app_id: 'qkkbptetyohxoiod',
app_secret: 'Wkp2a3NiNjAzTFJLRmwrZXN3QW1jZz09'
},
method: 'GET',
success: (results) => {
// console.log(results);
if (results.data.code == 0) {
// this.$api.msg(results.data.msg);
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
} else if (results.data.code == 1) {
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
// console.log(results)
}
},
fail: (results) => {
// console.log(results);
results.isScanCode = false; results.isScanCode = false;
results.code = res.result; results.code = res.result;
uni.navigateTo({ uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results) url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
}) })
console.log(results)
} }
})
}
},
fail: (results) => {
console.log(results);
results.isScanCode = false;
results.code = res.result;
uni.navigateTo({
url: '/pages/addEditEleProduct/addEditEleProduct?results=' + JSON.stringify(results)
})
}
})
} }
}); });
}, },
// 解析链接中的参数
/**
* 解析url地址的参数
* @param {string} urlStr
*/
GetRequest: (urlStr) => {
if (typeof urlStr == "undefined") {
var url = decodeURI(location.search); //获取url中"?"符后的字符串
} else {
var url = "?" + urlStr.split("?")[1];
}
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
var strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
}
}
return theRequest;
},
jump() { jump() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/edit/pro_manage/pro_manage?money_type=' + this.money_type + '&' + 'activity_type=' + this.activity_type url: '/pages/edit/pro_manage/pro_manage?money_type=' + this.money_type + '&' + 'activity_type=' + this.activity_type
...@@ -471,15 +524,15 @@ ...@@ -471,15 +524,15 @@
}) })
}, },
download() { download() {
let that = this let that = this
uni.showModal({ uni.showModal({
title: '复制链接在电脑端浏览器打开', title: '复制链接在电脑端浏览器打开',
content:`${that.$store.state.uploadurl}api/index/excel?shop_id=${this.shop_id}`, content: `${that.$store.state.uploadurl}api/index/excel?shop_id=${that.shop_id}`,
confirmText: '复制', confirmText: '复制',
success: function(res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.setClipboardData({ uni.setClipboardData({
data: `${that.$store.state.uploadurl}api/index/excel?shop_id=${this.shop_id}`, data: `${that.$store.state.uploadurl}api/index/excel?shop_id=${that.shop_id}`,
success: () => { //复制成功的回调函数 success: () => { //复制成功的回调函数
uni.showToast({ //提示 uni.showToast({ //提示
title: '复制成功' title: '复制成功'
...@@ -489,7 +542,7 @@ ...@@ -489,7 +542,7 @@
console.log('用户点击确定'); console.log('用户点击确定');
} else if (res.cancel) { } else if (res.cancel) {
console.log('用户点击取消'); console.log('用户点击取消');
} }
} }
}); });
...@@ -511,7 +564,7 @@ ...@@ -511,7 +564,7 @@
this.is_luck_draw = res.data.shop_info.is_luck_draw this.is_luck_draw = res.data.shop_info.is_luck_draw
this.money_type = res.data.shop_info.money_type this.money_type = res.data.shop_info.money_type
this.activity_type = res.data.shop_info.activity_type //判断是否有秒杀资格 this.activity_type = res.data.shop_info.activity_type //判断是否有秒杀资格
console.log(this.shop_type,'aa')
} else { } else {
this.$api.msg(res.msg); this.$api.msg(res.msg);
} }
......
//快速发货
.delivery{
min-height: 100vh;
background: #F2F3F3;
padding: 20upx 0;
}
.fahuobox{
margin: 0 24upx;
padding: 0 20upx;
padding-bottom: 60upx;
background: #FFFFFF;
.selectcell{
height: 107upx;
line-height: 107upx;
border-bottom: 1px solid #F4F4F4;
.names{
font-size:30upx;
color:rgba(0,0,0,1);
}
.icons1{
width:48upx;
height:38upx;
margin-right: 26upx;
}
.icons2{
width:10upx;
height:18upx;
}
.icons3{
width:39upx;
height:42upx;
margin-right: 26upx;
}
.tosaomaboxs{
width: 50px;
text-align: right;
}
.icons4{
width:25upx;
height:25upx;
}
}
}
.btnsbox{
margin-top: 60upx;
.btns{
width:300upx;
height:90upx;
line-height: 90upx;
text-align: center;
border:1px solid rgba(160,160,160,1);
border-radius:6upx;
font-size:32upx;
color:rgba(0,0,0,1);
}
.btns1{
border:0;
background: #FF6600;
color:#FFFFFF;
}
}
\ No newline at end of file
<template>
<!-- 商家发货 -->
<view class="delivery fahuo yocode">
<view class="fahuobox">
<!-- <picker @change="bindPickerChange" :value="index" :range="logsitslist"> -->
<view class="selectcell flex ali-c jus-b" @tap='pickerone'>
<view class="flex ali-c">
<image class="icons1" src="/static/news/fahuo.png" mode=""></image>
<view class="names">{{chindtext==''?'选择快递公司':chindtext}}</view>
</view>
<image class="icons2" src="/static/news/xiala.png" mode=""></image>
</view>
<lb-picker ref="picker" :list="logsitslist" :value='chindtext' range-key="label" :props="myProps" @confirm='confirm'></lb-picker>
<!-- </picker> -->
<view class="selectcell flex ali-c jus-b">
<view class="flex ali-c">
<image class="icons3" src="/static/news/dindhao.png" mode=""></image>
<input class="names" type="text" value="" v-model="logscode" placeholder="输入快递单号" />
</view>
<view @tap="tosaoyisao" class="tosaomaboxs">
<image class="icons4" src="/static/news/saoma.png" mode=""></image>
</view>
</view>
<view class="btnsbox flex ali-c jus-a">
<view class="btns">取消</view>
<view class="btns btns1" @tap="oneKeyShipmentsfun">确定发货</view>
</view>
</view>
</view>
</template>
<script>
import { logisticsList,setDeliverGoods } from '@/utils/api/api.js';
export default{
data(){
return{
myProps: {
label: 'value',
value: 'cate_id',
},
logsitslist:[
"圆通速递",
"百世快递",
"中通快递",
"申通快递",
"顺丰速运",
"韵达速递",
"邮政快递包裹",
"EMS",
"天天快递",
"京东快递",
"优速快递",
"德邦快递",
"宅急送",
"TNT快递",
"UPS",
"DHL",
"FEDEX联邦(国内件)",
"FEDEX联邦(国际件)"
],
index:0,
chindtext:"",
logscode:"",
refund_id: '',//订单id
}
},
onLoad(options) {
this.refund_id = options.refund_id;
// console.log(this.refund_id)
this.logisticsListfun();
},
methods:{
confirm(e){
console.log(e)
this.chindtext=e.value;
},
pickerone(){
this.$refs.picker.show() // 显示
},
async logisticsListfun(){
let res = await logisticsList({
});
if(res.code==0){
this.logsitslist =res.data;
}else{
this.$api.msg(res.msg);
}
},
//快速发货 确认发货
async oneKeyShipmentsfun(){
if(this.chindtext==""){
this.$api.msg("请选中快速公司");
return false;
}
if(this.logscode==""){
this.$api.msg("物流单号不能为空");
return false;
}
let res = await setDeliverGoods({
logisticCode:this.logscode,//物流号 快递单号 订单号
shipperCode:this.chindtext,//名称 快递公司编号 名称
refund_id:this.refund_id,//订单id 订单id
shop_id:'',
});
if(res.code==0){
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success(res) {
uni.$emit("isDelorder",{action: 'setDeliverGoods'});
uni.navigateBack({}); //返回上一页
}
})
}else{
this.$api.msg(res.msg);
}
},
//请求end
bindPickerChange(e){
console.log(e.detail.value,'哈哈哈');
this.chindtext = this.logsitslist[e.detail.value];
},
//扫码方法
tosaoyisao(){
uni.scanCode({
success: (res)=> {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
// let qrcodecon =
this.logscode = res.result;
}
});
}
}
}
</script>
<style lang="scss">
@import "ExamineDelivery.scss"
</style>
<template>
<!-- 添加收获地址 OK -->
<!-- 添加收货地址呀 -->
<view class="content addddd yicode">
<view class="row b-b">
<text class="tit">收货人</text>
<input class="input" type="text" v-model="name" placeholder="请填写收货人姓名" placeholder-class="placeholder" />
</view>
<view class="row b-b">
<text class="tit">手机号码</text>
<input class="input" type="number" v-model="mobile" placeholder="请填写手机号码" placeholder-class="placeholder" />
</view>
<view class="row b-b">
<text class="tit">收货地址</text>
<input class="input" type="text" v-model="address" placeholder="请填写详细地址" placeholder-class="placeholder s24" @input="doorplate" />
</view>
<view class="submitbtn active" @tap="refundExamine">确定</view>
</view>
</template>
<script>
import { shopExamine } from '@/utils/api/api.js';
export default {
data() {
return {
name: '',
mobile: '',
address: '',
type: '',//退款退款 退款
refund_id: ''
}
},
onShow() {
},
onHide() {
},
onUnload(){
},
onLoad(option){
// console.log(option)
this.type = option.type;
this.refund_id = option.refund_id;
// console.log(this.refund_id,this.type)
},
methods: {
refundExamine(){//提交
if(!this.name){
this.$api.msg('请填写收货人姓名');
return;
}
if(!/(^1[3|4|5|7|8|9][0-9]{9}$)/.test(this.mobile)){
this.$api.msg('请输入正确的手机号码');
return;
}
if(!this.address){
this.$api.msg('请输入详细收货地址');
return;
}
// 参数
let params = {
contacts: this.name,//收货联系人
contact_number : this.mobile,//收货联系电话
addr: this.address,//收货地址
type: this.type,
refund_id: this.refund_id,
}
shopExamine(params).then(res=>{
// console.log(res)
if(res.code == 0){
uni.$emit('isDelorder', { action: 'shopExamine' });//监听操作成功后跳回上一页自动刷新列表
uni.showToast({
title: '退款审核成功',
duration: 2000,
icon: 'none'
});
uni.navigateBack({})
}else{
this.$api.msg(res.msg);
}
})
},
}
}
</script>
<style lang="scss">
page {
background: $page-color-base;
padding-top: 16upx;
// margin-top: 20upx;
}
.row {
display: flex;
align-items: center;
position: relative;
padding: 0 30upx;
height: 88upx;
background: #fff;
.immgs {
width: 13upx;
height: 24upx;
opacity: 0.5;
}
.tit {
flex-shrink: 0;
//width: 120upx;
width: 200upx;
font-size: 30upx;
color: $font-color-dark;
}
.input {
flex: 1;
font-size: 30upx;
color: $font-color-dark;
}
.icon-shouhuodizhi {
font-size: 36upx;
color: $font-color-light;
}
}
.default-row {
margin-top: 16upx;
.tit {
flex: 1;
}
switch {
transform: translateX(16upx) scale(0.9);
}
}
.add-btn {
display: flex;
align-items: center;
justify-content: center;
width: 690upx;
height: 80upx;
margin: 60upx auto;
font-size: $font-lg;
color: #fff;
background-color: $base-color;
border-radius: 10upx;
box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
}
.addddd{
// margin-top: 40upx;
}
</style>
...@@ -163,4 +163,40 @@ ...@@ -163,4 +163,40 @@
} }
.mt-20{ .mt-20{
margin-top: 20upx; margin-top: 20upx;
}
.setSelect{
width:601upx;
height:660upx;
background:rgba(255,255,255,1);
border-radius:10upx;
.titelsf{
height: 88upx;
line-height: 88upx;
text-align: center;
font-size:32upx;
font-family:PingFang SC;
font-weight:bold;
color:rgba(0,0,0,1);
}
.selectbottom{
background: #FFFFFF;
padding: 0 24upx;
}
.setbtns{
margin: 0 auto;
margin-top: 90upx;
width:501upx;
height:88upx;
line-height:88upx;
text-align: center;
background:rgba(255,105,0,1);
border-radius:10upx;
font-size:32upx;
color:rgba(255,255,255,1);
}
}
.textarea{
font-size: 34upx;
padding: 30upx;
} }
\ No newline at end of file
...@@ -4,395 +4,688 @@ ...@@ -4,395 +4,688 @@
<!-- order 订单 --> <!-- order 订单 -->
<view class="storeOrder yocode"> <view class="storeOrder yocode">
<view class="ordertab flex ali-c"> <view class="ordertab flex ali-c">
<view class="tabitem flex1" @tap="taggletab" v-for="(item,index) in order_status_list" :key="index" data-current="1" :data-statusTab="item.status_id" :data-status="item.status" :data-is_dianping="item.is_dianping" :data-sale_status="item.sale_status" > <view
<view class="title" :class="{active:tabactive==item.status_id}" >{{item.status_name}}</view> class="tabitem flex1"
@tap="taggletab"
v-for="(item, index) in order_status_list"
:key="index"
data-current="1"
:data-statusTab="item.status_id"
:data-status="item.status"
:data-is_dianping="item.is_dianping"
:data-sale_status="item.sale_status"
>
<view class="title" :class="{ active: tabactive == item.status_id }">{{ item.status_name }}</view>
</view> </view>
</view> </view>
<!-- v-if="tabactive==1" --> <!-- v-if="tabactive==1" -->
<view class="listorder" > <!-- 正常订单 -->
<view class="orderItem" v-for="(item,indexMax) in order" :key="indexMax"> <view class="listorder">
<view class="orderItem" v-for="(item, indexMax) in order" :key="indexMax">
<view class="order_head flex ali-c jus-b"> <view class="order_head flex ali-c jus-b">
<view class="headl flex ali-c"> <view class="headl flex ali-c">
<image class="storeicon" src="/static/news/storeicon.png" mode=""></image> <image class="storeicon" src="/static/news/storeicon.png" mode=""></image>
<!-- <image class="storeicon" :src="staticUrl+item.photo" mode="" ></image> --> <!-- <image class="storeicon" :src="staticUrl+item.photo" mode="" ></image> -->
<view class="storename">{{item.shop_name}}</view> <view class="storename">{{ item.shop_name }}</view>
</view> </view>
<view class="headr"> <view class="headr">
<!-- 订单状态 --> <!-- 订单状态 -->
<view >{{item.order_status}}</view> <view>{{ item.order_status }}</view>
</view> </view>
</view> </view>
<view class="cretime mt-10"> <view class="cretime mt-10">下单时间:{{ item.create_time }}</view>
下单时间:{{item.create_time}}
</view>
<view> <view>
<!-- 列表 --> <!-- 列表 -->
<view class="order_body " v-for="(productList,index1) in item.products" :key="index1" > <view class="order_body " v-for="(productList, index1) in item.products" :key="index1">
<view class="flex mb-20" v-for="(product, index) in productList.orderGoods" :key="index">
<view class="flex mb-20" v-for="(product,index) in productList.orderGoods" :key="index">
<!-- <image class="imgs" src="" mode=""></image> --> <!-- <image class="imgs" src="" mode=""></image> -->
<image class="imgs" :src="staticUrl+product.photo" v-if="product.photo" mode=""></image> <image class="imgs" :src="staticUrl + product.photo" v-if="product.photo" mode=""></image>
<image class="imgs" :src="staticUrl+item.photo" mode="" v-else ></image> <image class="imgs" :src="staticUrl + item.photo" mode="" v-else></image>
<view class="body_r flex1 "> <view class="body_r flex1 ">
<view class="title twoline">{{product.goods_name}}</view> <view class="title twoline">{{ product.goods_name }}</view>
<view class="prices"> <view class="prices">
<text class="text">价格{{product.fprice}}</text> <text class="text">价格{{ product.fprice }}</text>
<!-- <text class="text">充值价{{product.recprice}}</text> --> <!-- <text class="text">充值价{{product.recprice}}</text> -->
</view> </view>
<view class="specs"> <view class="specs">
<text class="text">规格:{{product.sku_name}}</text> <text class="text">规格:{{ product.sku_name }}</text>
<!-- <text class="text">包装:2袋装</text> --> <!-- <text class="text">包装:2袋装</text> -->
<view>数量: x {{product.goodsnum}}</view> <view>数量: x {{ product.goodsnum }}</view>
</view> </view>
</view> </view>
</view> </view>
<view v-if="productList.operation!=''" class="order_foot bodbod flex jus-e mb-20 mt-20"> <view v-if="productList.operation != ''" class="order_foot bodbod flex jus-e mb-20 mt-20">
<block v-for="(action,index) in productList.operation" :key="index"> <block v-for="(action, index) in productList.operation" :key="index">
<view class='btnss' :data-index="indexMax" :data-orderid='item.order_id' :data-vendor='index1' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view> <view
</block> class="btnss"
:data-index="indexMax"
:data-orderid="item.order_id"
:data-vendor="index1"
@tap.stop="operation"
:data-action="action.way"
:data-is_ld="item.buytype"
>
{{ action.name }}
</view>
</block>
</view> </view>
</view> </view>
</view> </view>
<view class="order_foot flex jus-e mb-20 " > <view class="order_foot flex jus-e mb-20 ">
<view class="heji"><text class="fuhao">{{item.username_tel}}</text></view> <view class="heji">
<text class="fuhao">{{ item.username_tel }}</text>
</view>
</view> </view>
<view class="pricebox flex ali-c jus-b" style="margin-top: 20upx;"> <view class="pricebox flex ali-c jus-b" style="margin-top: 20upx;">
<!-- 剩余时间 只有待支付的时候有 未付款的时候才有 --> <!-- 剩余时间 只有待支付的时候有 未付款的时候才有 -->
<view class="titme oneline flex1" v-if="item.status==4">退款原因:{{item.refund_details}}</view> <view class="titme oneline flex1" v-if="item.status == 4">退款原因:{{ item.refund_details }}</view>
<view v-else></view> <view v-else></view>
<view class="heji">合计<text class="fuhao">¥</text><text class="shuzi">{{item.total}}</text></view> <view class="heji">
合计
<text class="fuhao">¥</text>
<text class="shuzi">{{ item.total }}</text>
</view>
</view> </view>
<view class="order_foot flex jus-e"> <view class="order_foot flex jus-e">
<!-- 已发货 --> <!-- 已发货 -->
<block v-for="(action,index) in item.order_operation" :key="index"> <block v-for="(action, index) in item.order_operation" :key="index">
<view class="btnss" :data-index="indexMax" :data-orderid="item.order_id" @tap.stop="operation" :data-action="action.way" :data-is_ld="item.buytype">
{{ action.name }}
</view>
</block>
</view>
</view>
</view>
<view class='btnss' :data-index="indexMax" :data-orderid='item.order_id' @tap.stop="operation" :data-action='action.way' :data-is_ld='item.buytype'>{{action.name}}</view> <!-- 售后/退款订单 -->
<view class="listorder">
<view class="orderItem" v-for="(item, indexMax) in refundOrder" :key="indexMax">
<view class="order_head flex ali-c jus-b">
<view class="headl flex ali-c">
<image class="storeicon" src="/static/news/storeicon.png" mode=""></image>
<!-- <image class="storeicon" :src="staticUrl+item.photo" mode="" ></image> -->
<view class="storename">{{ item.shop_name }}</view>
</view>
<view class="headr">
<!-- 订单状态 -->
<view>{{ item.status_text }}</view>
</view>
</view>
<view class="cretime mt-10">下单时间:{{ item.create_time }}</view>
<view>
<!-- 列表 -->
<view class="order_body " v-for="(product, index1) in item.ordergoods" :key="index1">
<view class="flex mb-20">
<!-- <image class="imgs" src="" mode=""></image> -->
<image class="imgs" :src="staticUrl + product.photo" v-if="product.photo" mode=""></image>
<image class="imgs" :src="staticUrl + item.photo" mode="" v-else></image>
<view class="body_r flex1 ">
<view class="title twoline">{{ product.goods_name }}</view>
<view class="prices">
<text class="text">价格{{ product.price }}</text>
<!-- <text class="text">充值价{{product.recprice}}</text> -->
</view>
<view class="specs">
<text class="text">规格:{{ product.sku_name }}</text>
<!-- <text class="text">包装:2袋装</text> -->
<view>数量: x {{ product.num }}</view>
</view>
</view>
</view>
</view>
</view>
<view class="order_foot flex jus-e mb-20 ">
<view class="heji">
<text class="fuhao">{{ item.username_tel }}</text>
</view>
</view>
<view class="pricebox flex ali-c jus-e" style="margin-top: 20upx;">
<!-- <view class="titme oneline flex1" v-if="item.status==4">退款原因:{{item.refund_details}}</view> -->
<!-- <view v-else></view> -->
<view class="heji">
合计
<text class="fuhao">¥</text>
<text class="shuzi">{{ item.refund_price }}</text>
</view>
</view>
<view class="order_foot flex jus-e">
<!-- shop_button 按钮 -->
<block v-for="(action, index) in item.shop_button" :key="index">
<view
class="btnss"
:data-index="indexMax"
:data-refundid="item.refund_id"
@tap.stop="operation"
:data-action="action.way"
:data-name="action.name"
:data-type="item.type"
>
{{ action.name }}
</view>
</block> </block>
</view> </view>
</view> </view>
</view> </view>
<pageScrollTo v-if="isshowtop" ></pageScrollTo> <pageScrollTo v-if="isshowtop"></pageScrollTo>
<!-- 返回顶部 --> <!-- 返回顶部 -->
<!-- 拒绝退款弹窗填写拒绝原因 -->
<uni-popup :show="showReasonRefusal" :mask-click="false" type="center">
<view class="setSelect">
<view class="titelsf">拒绝退款</view>
<view class="inputfboxs flex ali-c"><textarea class="textarea" value="" placeholder="请填写拒绝退款原因" selection-start="-1" @input="HandleReasonRefusal" /></view>
<view class="setbtns" @tap="saveReason">确定</view>
</view>
</uni-popup>
</view> </view>
</template> </template>
<script> <script>
// import { StoreorderStatus, orderGoodsList } from '@/utils/api/order.js'; // import { StoreorderStatus, orderGoodsList } from '@/utils/api/order.js';
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import { orderStatus, orderList, oneKeyCancel, consentRefund, refuseRefund, getRefundOrderList, setReceivingGoods, shopExamine } from '@/utils/api/api.js';
import pageScrollTo from '@/components/pageScrollTo/pageScrollTo.vue';
import {orderStatus,orderList,oneKeyCancel,consentRefund,refuseRefund} from "@/utils/api/api.js"; export default {
components: {
import pageScrollTo from "@/components/pageScrollTo/pageScrollTo.vue" pageScrollTo,
export default { uniPopup
components:{ },
pageScrollTo, data() {
}, return {
data(){ tabactive: 'all',
return{ statusTab: 'all',
tabactive:"all", status: '',
statusTab:"all", is_dianping: '',
status:"", order_status_list: [],
is_dianping:"", order: [], //正常订单
order_status_list:[], refundOrder: [], //售后订单
order:[], is_loading_done: false,
is_loading_done:false, pageNum: 0,
pageNum:0, currentTab: 0,
currentTab:0, sale_status: '',
sale_status:"", isshowtop: false,
isshowtop:false, action: '',
ReasonRefusal: '', //拒绝退款原因
action:'', showReasonRefusal: false //拒绝退款弹窗
};
},
computed: {
staticUrl() {
//静态资源地址
return this.$store.state.staticUrl;
}
},
//下拉刷新
onPullDownRefresh() {
this.is_loading_done = false;
this.pageNum = 0;
this.order = [];
this.initializedata();
},
onUnload() {
//页面卸载的时候
uni.setStorageSync('obj', { order_id: '', index: -1 });
uni.$off('isDelorder'); //取消监听
uni.setStorageSync('scrollTop', 0);
},
onPageScroll(e) {
//监听滚动
uni.setStorageSync('scrollTop', e.scrollTop);
//处理返回顶部
if (e.scrollTop > 400) {
this.isshowtop = true;
} else {
this.isshowtop = false;
}
},
onReachBottom() {
//滚动到最底部
if (!this.is_loading_done) {
this.initializedata();
}
},
onLoad(options) {
// console.log(options)
var that = this;
this.statusTab = options.current ? options.current : 'all'; // 订单状态
this.status = options.status ? options.status : 'all';
this.is_dianping = options.is_dianping ? options.is_dianping : 0;
let params = {};
orderStatus(params).then(res => {
if (res.code == 0) {
let order_status_list = res.data;
this.order_status_list = order_status_list;
} }
}, });
computed: { this.initializedata();
staticUrl () {//静态资源地址 },
return this.$store.state.staticUrl; onShow() {
this.action = '';
uni.$on('isDelorder', res => {
let index = uni.getStorageSync('obj').index;
let order = this.order;
this.action = res.action;
if (res.action == 'oneKeyShipments') {
//确认发货
if (this.status != 'all') {
//只有不是在全部订单下才删除这一项
order.splice(index, 1); //删除某项
this.$set(this, 'order', order);
} else {
this.listDeal();
}
} else if (res.action == 'setReceivingGoods' || res.action == 'shopExamine' || res.action == 'setDeliverGoods') {
//确认收货、商家审核、立即发货
this.listDeal2();
} }
},
//下拉刷新
onPullDownRefresh(){
this.is_loading_done=false;
this.pageNum = 0;
this.order = [];
this.initializedata();
},
onUnload(){ //页面卸载的时候
uni.setStorageSync('obj',{order_id:'',index:-1});
uni.$off('isDelorder'); //取消监听 uni.$off('isDelorder'); //取消监听
uni.setStorageSync('scrollTop',0); });
if (this.action == '') {
this.listDeal();
}
},
methods: {
// 重新刷新正常订单列表
listDeal() {
let order_id = uni.getStorageSync('obj').order_id;
let index = uni.getStorageSync('obj').index;
uni.showLoading({ title: '请稍后...' });
orderList({
status: this.status,
is_dianping: this.is_dianping,
sale_status: this.sale_status,
page: Math.ceil((index + 1) / 10)
}).then(res => {
uni.hideLoading();
for (let item of res.data) {
if (item.order_id == order_id) {
this.$set(this.order, index, item);
break;
}
}
});
}, },
onPageScroll(e){ //监听滚动 // 重新刷新售后订单列表
uni.setStorageSync('scrollTop',e.scrollTop); listDeal2() {
//处理返回顶部 let refund_id = uni.getStorageSync('refund').refund_id;
if(e.scrollTop>400){ let index = uni.getStorageSync('refund').index;
this.isshowtop = true; uni.showLoading({
}else{ title: '请稍后...'
this.isshowtop = false; });
} getRefundOrderList({
page: Math.ceil((index + 1) / 20),
pagesize: 20
}).then(res => {
console.log(res);
uni.hideLoading(); //结束加载
for (let item of res.data) {
if (item.refund_id == refund_id) {
this.$set(this.refundOrder, index, item);
break;
}
}
});
}, },
onReachBottom(){ //滚动到最底部
if(!this.is_loading_done){ totkxq(data) {
this.initializedata(); uni.showModal({
} title: '退款原因',
content: data,
showCancel: false,
confirmText: '我知道了',
confirmColor: '#ff6900',
success: res => {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}, },
onLoad(options) { //点击切换
var that = this; taggletab(event) {
this.statusTab=options.current ? options.current : "all";// 订单状态 let that = this;
this.status= options.status ? options.status : "all"; let statusTab = event.currentTarget.dataset.statustab;
this.is_dianping= options.is_dianping ? options.is_dianping : 0; let status = event.currentTarget.dataset.status;
let params = {}; let is_dianping = event.currentTarget.dataset.is_dianping;
orderStatus(params).then(res => { let sale_status = event.currentTarget.dataset.sale_status;
if (res.code == 0) { this.order = [];
let order_status_list = res.data; this.statusTab = statusTab;
this.order_status_list = order_status_list; this.tabactive = statusTab;
} this.status = status;
this.is_dianping = is_dianping;
}) this.sale_status = sale_status;
this.is_loading_done = false;
this.currentTab = event.target.dataset.current;
this.pageNum = 0;
this.initializedata(); this.initializedata();
}, },
onShow() { // 拒绝退款原因关闭弹窗
this.action=''; saveReason(e) {
uni.$on("isDelorder", res => { this.showReasonRefusal = false; //关闭弹窗
let index=uni.getStorageSync('obj').index; let refund_id = uni.getStorageSync('refund').refund_id;
let order=this.order; let params = {
this.action=res.action; examine_reason: this.ReasonRefusal,
if(res.action=="oneKeyShipments"){ //确认发货 refund_id: refund_id,
if(this.status!='all'){ //只有不是在全部订单下才删除这一项 shop_id: '',
order.splice(index,1); //删除某项 type: 2 //拒绝
this.$set(this,'order',order); };
}else{ if (!this.ReasonRefusal) {
this.listDeal(); this.$api.msg('请填写拒绝原因');
} return;
}
uni.$off('isDelorder'); //取消监听
})
if(this.action==''){
this.listDeal();
} }
shopExamine(params).then(res => {
}, // console.log(res)
methods:{ if (res.code == 0) {
listDeal(){ uni.$emit('isDelorder', { action: 'shopExamine' });
let order_id=uni.getStorageSync('obj').order_id;
let index=uni.getStorageSync('obj').index;
uni.showLoading({title:"请稍后..."});
orderList({
status: this.status,
is_dianping: this.is_dianping,
sale_status: this.sale_status,
page: Math.ceil((index+1)/10)
}).then(res => {
uni.hideLoading();
for(let item of res.data){
if(item.order_id==order_id){
this.$set(this.order,index,item);
break;
}
}
}) this.$api.msg('退款审核成功');
}, } else {
totkxq(data){ this.$api.msg(res.msg);
uni.showModal({ }
title: '退款原因', });
content: data, this.showReasonRefusal = false; //关闭弹窗
showCancel:false, },
confirmText:"我知道了", // 获取拒绝退款原因
confirmColor:"#ff6900", HandleReasonRefusal(e) {
success: (res)=> { this.ReasonRefusal = e.detail.value;
if (res.confirm) { },
console.log('用户点击确定'); /**
} else if (res.cancel) { * 初始化数据
console.log('用户点击取消'); */
} initializedata() {
} this.pageNum++;
}); uni.showLoading({
}, title: '加载中...'
//点击切换 });
taggletab(event){ var that = this;
let that = this; // 点击售后/退款请求新接口
let statusTab = event.currentTarget.dataset.statustab; if (that.statusTab == 7) {
let status = event.currentTarget.dataset.status; let params = {
let is_dianping = event.currentTarget.dataset.is_dianping; page: that.pageNum,
let sale_status = event.currentTarget.dataset.sale_status; shop_id: ''
this.order= []; };
this.statusTab= statusTab; getRefundOrderList(params).then(res => {
this.tabactive = statusTab;
this.status = status;
this.is_dianping= is_dianping;
this.sale_status= sale_status;
this.is_loading_done=false;
this.currentTab=event.target.dataset.current;
this.pageNum=0;
this.initializedata();
},
/**
* 初始化数据
*/
initializedata () {
this.pageNum++;
var that = this;
let params = {
status: that.status,
is_dianping: that.is_dianping,
sale_status: that.sale_status,
page: this.pageNum,
};
uni.showLoading({
title: '加载中...'
});
orderList(params).then(res => {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
uni.hideLoading();//结束加载 uni.hideLoading(); //结束加载
if (res.data == null || res.data.length == 0) { if (res.data == null || res.data.length == 0) {
this.is_loading_done= true; this.is_loading_done = true;
this.$api.msg("没有更多了~"); this.$api.msg('没有更多了~');
} else { } else {
this.order = [...this.order,...res.data] this.refundOrder = res.data;
} }
uni.pageScrollTo({ uni.pageScrollTo({
scrollTop: uni.getStorageSync('scrollTop'), scrollTop: uni.getStorageSync('scrollTop'),
duration: 0 duration: 0
}); });
}) });
}, return;
/** }
* 订单操作
*/ // 正常订单列表
operation (event) { let params = {
let that = this; status: that.status,
let action = event.currentTarget.dataset.action; is_dianping: that.is_dianping,
let order_id = event.currentTarget.dataset.orderid; sale_status: that.sale_status,
let vendor = event.currentTarget.dataset.vendor; page: this.pageNum
let index = Number(event.currentTarget.dataset.index);; };
uni.setStorageSync('obj',{order_id,index});
switch (action) { orderList(params).then(res => {
case 'oneKeyCancel': //一键核销 OK uni.stopPullDownRefresh();
that.requestOrder(order_id, action); uni.hideLoading(); //结束加载
console.info("一键核销"); if (res.data == null || res.data.length == 0) {
break; this.is_loading_done = true;
case 'oneKeyShipments': //一键发货 OK this.$api.msg('没有更多了~');
console.info("一键发货"); } else {
that.express(order_id, action,vendor); this.order = [...this.order, ...res.data];
break; }
case 'checkLogistics': //查看物流 uni.pageScrollTo({
that.logistics(order_id, action,vendor); scrollTop: uni.getStorageSync('scrollTop'),
console.info("查看物流"); duration: 0
break; });
case 'orderDetails': //订单详情 });
console.info("订单详情"); },
that.orderDetails(order_id,order_id); /**
break; * 订单操作
case 'consentRefund'://同意退款 */
this.clrefund(1,order_id,index); operation(event) {
break; let that = this;
case 'refuseRefund'://拒绝退款 let action = event.currentTarget.dataset.action;
this.clrefund(2,order_id,index); let order_id = event.currentTarget.dataset.orderid;
break; let vendor = event.currentTarget.dataset.vendor;
default: let index = Number(event.currentTarget.dataset.index);
//其他的 退款啥的 处理ok了 let refund_id = event.currentTarget.dataset.refundid;
console.info("1111",action); let name = event.currentTarget.dataset.name;
break; let type = event.currentTarget.dataset.type;
} uni.setStorageSync('obj', { order_id, index });
}, uni.setStorageSync('refund', { refund_id, index });
//处理退款 switch (action) {
clrefund(type,orderid,index){ case 'oneKeyCancel': //一键核销 OK
uni.showModal({ that.requestOrder(order_id, action);
title: '提示', console.info('一键核销');
content:type==1?'是否确定退款?':'是否拒绝退款', break;
success:(res)=> { case 'oneKeyShipments': //一键发货 OK
if(res.confirm){ console.info('一键发货');
new Promise((reslove, reject) =>{ that.express(order_id, action, vendor);
if(type==1){ //同意退款 break;
consentRefund({order_id:orderid}).then(res=>{ case 'checkLogistics': //查看物流
reslove(res) that.logistics(order_id, action, vendor);
}).catch(err=>{ console.info('查看物流');
reject(err) break;
case 'orderDetails': //订单详情
console.info('订单详情');
that.orderDetails(order_id, order_id);
break;
case 'consentRefund': //同意退款
this.clrefund(1, order_id, index);
break;
case 'refuseRefund': //拒绝退款
this.clrefund(2, order_id, index);
break;
// 售后/退款新接口
case 'getRefundDetail': //订单详情
that.getRefundDetail(refund_id);
break;
case 'viewLogistics': //查看物流
that.viewLogistics(refund_id);
break;
case 'setReceivingGoods': //确认收货
that.requestRefundOrder(refund_id, action);
break;
case 'shopExamine': //同意&拒绝
that.shopExamine(refund_id, name, type);
break;
case 'setDeliverGoods': //立即发货
that.setDeliverGoods(refund_id, action);
break;
default:
//其他的 退款啥的 处理ok了
// console.info('1111', action);
break;
}
},
// 正常订单
//处理退款
clrefund(type, orderid, index) {
uni.showModal({
title: '提示',
content: type == 1 ? '是否确定退款?' : '是否拒绝退款',
success: res => {
if (res.confirm) {
new Promise((reslove, reject) => {
if (type == 1) {
//同意退款
consentRefund({ order_id: orderid })
.then(res => {
reslove(res);
}) })
}else{ //拒绝退款 .catch(err => {
refuseRefund({order_id:orderid}).then(res=>{ reject(err);
});
} else {
//拒绝退款
refuseRefund({ order_id: orderid })
.then(res => {
reslove(res); reslove(res);
}).catch(err=>{
reject(err)
}) })
} .catch(err => {
reject(err);
}).then((res)=>{ });
if(res.code==0){ }
if(this.status!="all"){ })
let order=this.order; .then(res => {
order.splice(index,1); //删除某项 if (res.code == 0) {
this.$set(this,'order',order); if (this.status != 'all') {
}else{ let order = this.order;
order.splice(index, 1); //删除某项
this.$set(this, 'order', order);
} else {
this.listDeal(); this.listDeal();
} }
}else{ } else {
this.$api.msg(returnRes.msg); this.$api.msg(returnRes.msg);
} }
}).catch((err)=>{
console.log(err,'失败了');
//this.$api.msg(err.msg)
}) })
} .catch(err => {
console.log(err, '失败了');
//this.$api.msg(err.msg)
});
} }
}) }
}, });
//查看物流 },
logistics: function (order_id, action,vendor) { //查看物流
uni.navigateTo({ logistics: function(order_id, action, vendor) {
url: '/pages/ViewLogistics/ViewLogistics?order_id=' + order_id + '&action=' + action + '&vendor=' + vendor uni.navigateTo({
}) url: '/pages/ViewLogistics/ViewLogistics?order_id=' + order_id + '&action=' + action + '&vendor=' + vendor
}, });
//跳转订单详情 商家查看店铺的订单详情 },
orderDetails: function (order_id) { //跳转订单详情 商家查看店铺的订单详情
uni.navigateTo({ orderDetails: function(order_id) {
url:`/pages/order/shoporderdetail/shoporderdetail?order_id=${order_id}`, uni.navigateTo({
}) url: `/pages/order/shoporderdetail/shoporderdetail?order_id=${order_id}`
}, });
// 跳转发快递订单 ok 发货 },
express (order_id, action,vendor) { // 跳转发快递订单 ok 发货
uni.navigateTo({ express(order_id, action, vendor) {
url: '/pages/order/delivery/delivery?order_id=' + order_id + '&action=' + action + '&vendor=' + vendor uni.navigateTo({
}) url: '/pages/order/delivery/delivery?order_id=' + order_id + '&action=' + action + '&vendor=' + vendor
}, });
//请求后台操作订单 一键核销 },
requestOrder(order_id, action) { //请求后台操作订单 一键核销
var that = this; requestOrder(order_id, action) {
let params = { var that = this;
order_id: order_id, let params = {
//action: action, order_id: order_id
}; //action: action,
//一键核销方法 };
oneKeyCancel(params).then(res => { //一键核销方法
if (res.code == 0) { oneKeyCancel(params).then(res => {
uni.showModal({ if (res.code == 0) {
title: '提示', uni.showModal({
content: res.msg, title: '提示',
showCancel: false, content: res.msg,
success(res) { showCancel: false,
uni.redirectTo({ success(res) {
url: '/pages/order/shopOrder?status=' + that.status + "&current=" + that.statusTab, uni.redirectTo({
}) url: '/pages/order/shopOrder?status=' + that.status + '&current=' + that.statusTab
} });
}) }
} else { });
this.$api.msg(res.msg); } else {
} this.$api.msg(res.msg);
}) }
}, });
},
// 售后/退款订单
// 订单详情
getRefundDetail: function(refund_id) {
uni.navigateTo({
url: `/pages/order/shoprefundorderdetail/shoprefundorderdetail?refund_id=${refund_id}`
});
},
//查看物流
viewLogistics: function(refund_id) {
uni.navigateTo({
url: `/pages/ViewLogistics/ViewLogistics?refund_id=${refund_id}`
});
},
//立即发货
setDeliverGoods:function(refund_id) {
uni.navigateTo({
url: '/pages/order/ExamineDelivery/ExamineDelivery?refund_id=' + refund_id
});
},
// 请求后台操作售后订单确认收货
requestRefundOrder: function(refund_id, action) {
let params = {
refund_id: refund_id,
shop_id: ''
};
setReceivingGoods(params).then(res => {
// console.log(res);
if (res.code == 0) {
uni.$emit('isDelorder', { action: 'setReceivingGoods' });
uni.showToast({
title: '收货成功',
duration: 2000,
icon: 'none'
});
this.listDeal2(); //确认收货成功自动刷新售后列表
} else {
this.$api.msg(res.msg);
}
});
},
// 请求后台操作售后订单同意&拒绝
shopExamine: function(refund_id, name, type) {
if (name == '同意') {
if (type == 3) {
//直接退款
var params = {
refund_id: refund_id,
shop_id: '',
type: 1
};
uni.showModal({
title: '提示',
content: '请问是否确认同意退款?',
success: res => {
if (res.confirm) {
shopExamine(params).then(res => {
if (res.code == 0) {
uni.$emit('isDelorder', { action: 'shopExamine' });
uni.showToast({
title: '操作成功',
duration: 2000,
icon: 'none'
});
this.listDeal2(); //同意退款后自动刷新售后列表
}
});
}
}
});
} else if (type == 1 || type == 2) {
//退款退货 换货refund_id, name, type
uni.navigateTo({
url: `/pages/order/shopExamine/shopExamine?refund_id=${refund_id}&type=${type}`
});
}
} else if (name == '拒绝') {
this.showReasonRefusal = true;
}
} }
} }
};
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./shopOrder.scss" @import './shopOrder.scss';
</style> </style>
<template>
<!-- 商家查看自己店铺的售后订单详情 -->
<!-- 订单 order -->
<view class="shoporderdetale xiangq yocode">
<view class="beijingimg" style="height:80px">
<!-- <view class="onetitle">{{detail.orderstatus}}</view>
<view class="twotitle">{{detail.statusdesc}}</view> -->
</view>
<view class="boxs">
<view class="topbox_20 addresone">
<view class="ali-c">
<view class="weizhiimg"><image class="imgs" src="/static/news/address.png"></image></view>
<view class="flex1 ml-20 addrnamesv">
<view class="sz_30 bt_hei">{{ detail.adress.name }} {{ detail.adress.mobile }}</view>
<view class="sz_30 bt_hei mt-10">{{ detail.adress.addr }}</view>
</view>
</view>
</view>
<!-- 退款进度及图片 -->
<!-- <view class="topbox_20 mt-20">
<view class="ali-z sz_30 flexv jus-c ali-c" style="height: 200upx;">
<image src="https://luma.jxdsy.cn/static/applet5/images/refund/tuikuan2.png" mode="" style="width: 530upx;height: 76upx;"></image>
<view style="color: #F64F15;margin-top: 40upx;">{{ detail.status_text }}</view>
</view>
</view> -->
<!-- 售后说明 -->
<view class="topbox_20 mt-20">
<view style="font-size: 30upx;font-weight: 500;">售后说明</view>
<view class="mt-20">{{ detail.refund_datail ? detail.refund_datail : '暂无说明' }}</view>
<view v-if="detail.refund_pics.length>0">
<image
:src="staticUrl + item"
mode=""
v-for="(item, index) in detail.refund_pics"
style="width: 244upx;height: 220upx;padding: 0 20upx 0 0;margin: 10upx 0upx;"
></image>
</view>
</view>
<view class="topbox_20 mt-20">
<view class="ali-c">
<view class="tubiimg mr-20"><image class="imgs" src="/static/news/storeicon.png"></image></view>
<view class="bt_min flex1">{{ detail.shop_name }}</view>
</view>
<view class="flex mt-30" v-for="(item, index) in detail.ordergoods" :key="index">
<view class="tuimg br_10 ov">
<image class="imgs" :src="staticUrl + item.photo" v-if="item.photo"></image>
<image class="imgs" :src="staticUrl + detail.photo" v-else></image>
</view>
<view class="flex1 ml-25 goodsboxs">
<view class="sz_30 bt_hei twoline names" style="height:65upx">{{ item.goods_name }}</view>
<view class="sz_26 bt_hei mt-10 prices">
价格{{ item.price }}
<!-- <text class="ml-20 prices" v-if="detail.buytype==0 && item.recprice >0">充值价{{item.recprice}}</text> -->
</view>
<view class="sz_26 inp_hui mt-10 skunames">
规格:{{ item.sku_name }}
<text class="ml-20"></text>
</view>
<view class="sz_26 inp_hui mt-10 sumns">数量: x {{ item.num }}</view>
</view>
</view>
</view>
<view class="topbox_20 mt-20 ">
<view class="ali-z sz_30 bt_hei flex ali-c jus-b">
<view>总计:</view>
<view style="color: red;">¥{{ detail.need_pay }}</view>
</view>
</view>
<!-- 第二排 -->
<view class="cellboxs cellboxstow">
<view class="subsbox cellitems flex ali-c jus-b"><view class="name">订单信息</view></view>
<view class="cellitems flex ali-c jus-b">
<view class="name">订单编号</view>
<view class="vlas">{{ detail.order_sn }}</view>
</view>
<view class="cellitems flex ali-c jus-b">
<view class="name">创建时间</view>
<view class="vlas">{{ detail.create_time }}</view>
</view>
<!-- <view class="cellitems flex ali-c jus-b">
<view class="name">退款原因</view>
<view class="vlas">{{ detail.refund_datail }}</view>
</view> -->
<!-- <view class="cellitems flex ali-c jus-b">
<view class="name">退款图片</view>
<view class="vlas">{{ detail.refund_pics }}</view>
</view> -->
</view>
<!-- 订单信息 -->
<!-- 联系客服 -->
<view class="ordertelbox flex ">
<view class="itemboxss flex1 flex flexc" @tap="xlsj" :data-tel="detail.adress.mobile">
<image class="img" src="/static/news/telicon1.png" mode=""></image>
<view class="name">联系客户</view>
</view>
<view class="itemboxss flex1 flex flexc" @tap="lxpt">
<image class="img" src="/static/news/kefuicon.png" mode=""></image>
<view class="name">联系平台</view>
</view>
</view>
</view>
<!-- 底部按钮 -->
<!-- <view class="flexfootsubbtn flex jus-e ali-c order_foot" style="border-top: 1px solid #DEDEDE;" v-if="detail.buttons != ''">
<view
:class="[item.way == 'shopExamine' ? 'btnitemTow' : 'btnitem', item.class_name]"
@tap.stop="operation(item.way)"
v-for="(item, index) in detail.buttons"
:key="index"
>
{{ item.name }}
</view>
</view> -->
</view>
</template>
<script>
import { getRefundDetail } from '@/utils/api/api.js';
export default {
data() {
return {
refund_id: '',
detail: '' //售后详情
// logs:{},
};
},
computed: {
staticUrl() {
//静态资源地址
return this.$store.state.staticUrl;
}
},
onLoad(options) {
this.refund_id = options.refund_id;
this.initializedata();
},
methods: {
xlsj() {
//联系客户
uni.makePhoneCall({
phoneNumber: this.detail.addr.mobile //仅为示例
});
},
//联系平台
lxpt() {
uni.makePhoneCall({
phoneNumber: '15907083784' //仅为示例
});
},
initializedata() {
var that = this;
let params = {
refund_id: that.refund_id
};
getRefundDetail(params).then(res => {
// console.log(res);
if (res.code < 0) {
// app.showToast({title: res.msg});
this.$api.msg(res.msg);
} else {
this.detail = res.data;
// this.logs = res.data.logs;
//this.CONFIG =
}
});
},
callTel: function(e) {
uni.makePhoneCall({
phoneNumber: e.currentTarget.dataset.tel // 仅为示例,并非真实的电话号码
});
}
}
};
</script>
<style lang="scss">
/* pages/shop//order/weidianorder/weidianLine_item/weidianLine_item.wxss */
.ml-20 {
margin-left: 20upx;
}
.mt-20 {
margin-top: 20upx;
}
.mr-20 {
margin-right: 20upx;
}
.mt-30 {
margin-top: 30upx;
}
.ml-25 {
margin-left: 25upx;
}
.sz_30 {
font-size: 30upx;
}
.beijingimg {
background: linear-gradient(#ff5a03, #ff4216);
width: 100%;
height: 300upx;
position: absolute;
top: 0;
z-index: 1;
padding-left: 20upx;
padding-top: 25px;
.onetitle {
color: #ffffff;
font-size: 30upx;
}
.twotitle {
color: #ffffff;
font-size: 28upx;
}
}
.addresone {
margin-top: 20px;
}
.boxs {
position: relative;
z-index: 2;
width: 100%;
padding: 24upx;
box-sizing: border-box;
}
.bt_min {
font-size: 30upx;
}
.addrnamesv {
font-size: 30upx;
}
.topbox_20 {
width: 100%;
background: rgba(255, 255, 255, 1);
border-radius: 14rpx;
padding: 20upx;
box-sizing: border-box;
font-size: 30upx;
}
.skunames {
font-size: 24upx;
}
page {
position: relative;
padding-bottom: 100upx;
background: #f5f5f5;
}
.weizhiimg {
width: 30upx;
height: 46upx;
.imgs {
width: 30upx;
height: 46upx;
}
}
.shuwuimg {
width: 67upx;
height: 67upx;
border-radius: 4upx;
overflow: hidden;
}
.btbox {
width: 190upx;
height: 77upx;
background: rgba(255, 255, 255, 1);
border-radius: 4upx;
}
.xiangyouimg {
width: 14upx;
height: 24upx;
}
.dianhuimg {
width: 42upx;
height: 42upx;
}
.kuai {
width: 40upx;
height: 40upx;
text-align: center;
line-height: 40upx;
font-size: 24upx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
.dibu_qr {
position: fixed;
bottom: 0;
width: 100%;
background: rgba(255, 255, 255, 1);
padding: 10upx 24upx;
box-sizing: border-box;
}
.beizhu {
width: 150upx;
text-align: right;
}
.tubiimg {
width: 27upx;
height: 24upx;
.imgs {
width: 27upx;
height: 24upx;
}
}
.tuimg {
width: 183upx;
height: 183upx;
.imgs {
width: 183upx;
height: 183upx;
}
}
view {
line-height: 112%;
letter-spacing: 3upx;
}
.dianhuimg {
width: 43upx;
height: 43upx;
}
.shuxian {
width: 1px;
height: 100upx;
background: rgba(242, 242, 242, 1);
}
.duanxian {
width: 45upx;
height: 1px;
background: rgba(181, 181, 181, 1);
}
.cptjimg {
width: 100%;
height: 310upx;
}
/* 取消弹窗 */
.zan-dialog__mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
background: rgba(0, 0, 0, 0.5);
display: none;
}
.zan-dialog__container {
position: fixed;
bottom: 400upx;
width: 650upx;
height: 350upx;
margin-left: 50upx;
background: #f8f8f8;
transform: translateY(300%);
transition: all 0.4s ease;
z-index: 12;
border-radius: 20upx;
/* box-shadow: 0px 3px 3px 2px gainsboro; */
}
.zan-dialog--show .zan-dialog__container {
transform: translateY(0);
}
.zan-dialog--show .zan-dialog__mask {
display: block;
}
.goodsboxs {
font-size: 30upx;
.names {
font-size: 30upx;
}
.prices {
font-size: 30upx;
}
.sumns {
color: rgb(192, 190, 190);
}
}
//联系kefu 客服
.ordertelbox {
margin: 0 24upx;
margin-top: 20upx;
height: 89upx;
background: rgba(255, 255, 255, 1);
border-radius: 0px 0px 14upx 14upx;
.itemboxss {
position: relative;
height: 89upx;
line-height: 89upx;
.img {
width: 43upx;
height: 43upx;
margin-right: 20upx;
}
.name {
font-size: 30upx;
color: rgba(0, 0, 0, 1);
}
}
.itemboxss:nth-child(1):after {
content: '';
width: 1px;
height: 89px;
background: rgba(242, 242, 242, 1);
position: absolute;
top: 0;
right: 0;
}
}
//客服end
//价格明细列表
.cellboxs {
margin: 20upx 0;
margin-top: 20upx;
.cellitems {
padding: 0 20upx;
height: 88upx;
line-height: 88upx;
border-bottom: 1px solid #f5f1f1;
background: #ffffff;
.name {
font-size: 30upx;
color: rgba(0, 0, 0, 1);
}
.vlas {
font-size: 30upx;
color: rgba(0, 0, 0, 1);
}
}
.cellitems:nth-last-child(1) {
border: 0;
}
.subsbox {
.name {
font-size: 30upx;
font-family: PingFang SC;
font-weight: bold;
color: rgba(0, 0, 0, 1);
}
.vlas {
color: #ff6900;
.fuhao {
font-size: 30upx;
}
.shuzi {
font-family: PingFang SC;
font-weight: bold;
font-size: 36upx;
}
}
}
}
// .cellboxstow{
// margin-top: 0;
// margin-bottom: 0;
// }
</style>
<template>
<view>
<view class="">
<view class="" style="text-align: center;height: 120upx;line-height: 120upx;font-weight: bold;font-size: 32upx;">
已有 <text style="color: #21B94C;font-size: 60upx;">{{receivePeopleNumber}}</text>人领取 还剩{{unreceivePeopleNumber}}人未核销
</view>
</view>
<view class="" style="height: 160upx;padding: 0 24upx;background-color: rgb(255, 255, 255);margin-bottom: 20upx;" v-if="getDetail.length > 0 " v-for="(item,index) in getDetail">
<view class="fx " style="justify-content: space-between;background-color: #fff; align-items: center;
height: 100%">
<view class="fx" style="width: 75%;align-items: center;" >
<view style="height: 120upx;width: 120upx;border-radius: 120upx;text-align: center;line-height: 80upx;overflow: hidden;">
<image :src="item.face" style="display: inline;"></image>
</view>
<view style="margin:0 0 0 10upx;width: 75%;padding: 20upx 10upx;">
<view style="font: 34upx 微软雅黑;padding-bottom:10upx ;" class="oneline">{{item.nickname}}</view>
<view style="font-size:20upx;color:rgb(116, 113, 113);padding-top: 10upx;">{{item.verification_time}}</view>
</view>
</view>
<view style="width: 15%;height: 104upx;">
<!-- <text style="color:#DC143C;padding: 0 12upx;border-radius: 10upx;font-size: 32upx;">
</text> -->
<image src="/static/lingqu.png" mode="" style="width:100% ;height: 100%;display: inline;"></image>
</view>
<!-- 关注插槽 -->
<!-- <slot name="before"></slot> -->
</view>
<!-- <slot name="content"> </slot> -->
</view>
<view v-if="getDetail.length <= 0" style="text-align: center;width: 100%;height:1000upx;line-height: 1000upx;font-size: 50upx;color:#8C8C8C ;">
还没有人领取~~
</view>
</view>
</template>
<script>
import {
activity_user
} from '@/utils/api/merchant.js';
export default {
data(){
return {
shop_id:'',
activity_id:'',
getDetail:[],
page:1,
receivePeopleNumber:0,
unreceivePeopleNumber:0,
}
},
onReachBottom() {
activity_user({
shop_id:this.shop_id,
activity_id:this.activity_id,
nucleus:1,
page:this.page
}).then(res=>{
if(res.code==0&&res.data.list.length>0){
this.page++
this.getDetail = res.data.list;
this.receivePeopleNumber=res.data.receivePeopleNumber;
this.unreceivePeopleNumber=res.data.unreceivePeopleNumber;
uni.stopPullDownRefresh();
}else{
uni.$api.msg('没有更多数据了')
}
})
},
onPullDownRefresh() {
this.page = 1
activity_user({
shop_id:this.shop_id,
activity_id:this.activity_id,
nucleus:1
}).then(res=>{
if(res.code==0){
this.getDetail = res.data.list
this.receivePeopleNumber=res.data.receivePeopleNumber;
this.unreceivePeopleNumber=res.data.unreceivePeopleNumber;
uni.stopPullDownRefresh();
}
})
},
onLoad(options) {
let that = this
that.activity_id = options.activity_id
uni.getStorage({
key: 'userInfo',
success(res) {
that.shop_id = res.data.shop_id
}
})
activity_user({
shop_id:that.shop_id,
activity_id:that.activity_id,
nucleus:1
}).then(res=>{
if(res.code==0){
this.getDetail = res.data.list;
this.receivePeopleNumber=res.data.receivePeopleNumber;
this.unreceivePeopleNumber=res.data.unreceivePeopleNumber;
}
})
},
}
</script>
<style>
page{
background-color: #EEEEEE;
}
.fx {
display: flex;
}
.guanzhu {
padding: 24upx;
border-top: 2upx solid #eee;
/* border-bottom: 1upx solid #eee; */
}
.pd24 {
padding: 24upx
}
</style>
<template>
<view class="">
<!-- tab切换 -->
<view class="projuctTab flex">
<view class="tabitems flex1" :class="{active:tabactive==1}" @tap="taggletab(1)">
<view class="tabtitle">开始活动</view>
<!-- ({{count[0]}}) -->
</view>
<view class="tabitems flex1" :class="{active:tabactive==2}" @tap="taggletab(2)">
<view class="tabtitle">过期活动</view>
<!-- ({{count[1]}}) -->
</view>
</view>
<view class="projuctlist" :hidden="!(tabactive==1)">
<view class="" v-if="start_activity.length>0">
<checkbox-group >
<!-- 单个商品 -->
<view class="itempro flex " v-for="(item,index) in start_activity" :key="index" @click="jumpDetail(item.activity_id)">
<!-- <label class="ali-c">
<checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> -->
<image class="thumbnail" :src="staticUrl + item.picture" mode=""></image>
<view class="infobox" style="width: 70%;">
<view class="title oneline" style="height:45upx ;">{{item.goods_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view>
<view style="font-size:26rpx;font-weight:bold;">领取时间:</view>
<view style="font-size:24rpx;color:#656565">{{item.start}}{{item.end}}</view>
</view>
</view>
<view class="btnbox flex" >
<!-- <view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view> -->
<!-- <view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view> -->
<!-- <view class="btns btnboxxj" @tap="sold_outfun(item.id,1,index)" v-else-if="tabactive==1">下 架</view> -->
<!-- <view class="btns btnboxxj" @tap="sold_outfun(item.id,0,index)" v-show="tabactive==2">上 架</view> -->
<!-- <view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view> -->
<view >
<view class="btnboxdel flex" style="align-items: center;" @click.stop="switch1Change">
活动开关:<switch :data-activity_id="item.activity_id" :checked="item.state==1" @change="switch1Change" />
<view class="btns btnboxdel" @tap.stop="tochanges(item,index)">修 改</view>
</view>
</view>
</view>
</view>
</checkbox-group>
</view>
<view v-if="start_activity.length <= 0" style="text-align: center;width: 100%;height:1000upx;line-height: 1000upx;font-size: 50upx;color:#8C8C8C ;">
还没有人领取~~
</view>
</view>
<view class="projuctlist" :hidden="!(tabactive==2)">
<view class="" v-if="end_activity.length > 0">
<checkbox-group >
<!-- 单个商品 -->
<view class="itempro flex " v-for="(item,index) in end_activity" :key="index" @click="jumpDetail(item.activity_id)">
<!-- <label class="ali-c">
<checkbox :value="item.id.toString()" :checked="item.checked==true" />
</label> -->
<image class="thumbnail" :src="staticUrl + item.picture" mode=""></image>
<view class="infobox" style="width: 70%;">
<view class="title oneline">{{item.goods_name}}</view>
<!-- <view class="time">上架时间:{{item.create_time}}</view> -->
<view>
<view style="font-size:26rpx;font-weight:bold;">领取时间:</view>
<view style="font-size:24rpx;color:#656565">{{item.start}}{{item.end}}</view>
</view>
</view>
<view class="btnbox flex">
<!-- <view class="btns btnboxdel" @tap="deleteEleProductfun(item,index)">删 除</view> -->
<!-- <view class="btns btnboxxj" @tap="Selectiondata(item)" v-if="tabactive==1 && isselect==1">加入活动</view> -->
<!-- <view class="btns btnboxxj" @tap="sold_outfun(item.id,1,index)" v-else-if="tabactive==1">下 架</view> -->
<!-- <view class="btns btnboxxj" @tap="sold_outfun(item.id,0,index)" v-show="tabactive==2">上 架</view> -->
<!-- <view class="btns btnboxxj" @click="setSpecs(item.product_id)" >规格</view> -->
<!-- <view class="btnboxdel">
活动开关:<switch :checked="chdecked" @change="switch1Change" />
</view>
<view class="btns btnboxdel" @tap="tochanges(item,index)">修 改</view> -->
</view>
</view>
</checkbox-group>
</view>
<view v-if="end_activity.length <= 0" style="text-align: center;width: 100%;height:1000upx;line-height: 1000upx;font-size: 50upx;color:#8C8C8C ;">
还没有人领取~~
</view>
</view>
<view class="footchindbox flex ali-c jus-b">
<navigator url="/pages/publishActivities/publishActivity/publishActivity" class="submitbtns">发布活动</navigator>
</view>
</view>
</template>
<script>
import {
activity_select,
activity_close
} from '@/utils/api/merchant.js';
export default {
data() {
return {
tabactive: 1,
page: 0,
start_activity: [],
end_activity: [],
endpages:0,
startpages:0
}
},
computed: {
staticUrl() { //静态资源地址
return this.$store.state.staticUrl;
}
},
onLoad() {
console.log('onl;oafdas')
let that = this
uni.getStorage({
key: 'userInfo',
success(res) {
that.shop_id = res.data.shop_id
}
})
},
//下拉刷新
onPullDownRefresh(){
if(this.tabactive == 1){
this.startpages = 0
activity_select({
shop_id: this.shop_id,
page: 0,
is_date: 2
}).then(res => {
if (res.code == 0) {
this.start_activity = res.data.data
uni.stopPullDownRefresh();
}
})
}else if(this.tabactive == 2){
this.endpages = 0
activity_select({
shop_id: this.shop_id,
page: 0,
is_date: 1
}).then(res => {
if (res.code == 0) {
this.end_activity = res.data.data
uni.stopPullDownRefresh();
}
})
}
},
//上拉触底
onReachBottom(){
if (this.tabactive == 1) {
activity_select({
shop_id: this.shop_id,
page: ++this.startpages,
is_date: 2
}).then(res => {
if (res.code == 0) {
this.start_activity = [...this.start_activity,...res.data.data]
}
})
} else if (this.tabactive == 2) {
activity_select({
shop_id: this.shop_id,
page: ++this.endpages,
is_date: 1
}).then(res => {
if (res.code == 0) {
this.end_activity = [...this.this.end_activity,...res.data.data]
}
})
}
},
onShow() {
this.endpages = 0
this.startpages = 0
if (this.tabactive == 1) {
activity_select({
shop_id: this.shop_id,
page: 0,
is_date: 2
}).then(res => {
if (res.code == 0) {
this.start_activity = res.data.data
}
})
} else if (this.tabactive == 2) {
activity_select({
shop_id: this.shop_id,
page: 0,
is_date: 1
}).then(res => {
if (res.code == 0) {
this.end_activity = res.data.data
}
})
}
},
methods: {
jumpDetail(activity_id){
uni.navigateTo({
url:`/pages/publishActivities/activityDetail/activityDetail?activity_id=${activity_id}`
})
},
//修改活动
tochanges(data, index) {
uni.navigateTo({
url: `/pages/publishActivities/publishActivity/publishActivity?id=${data.activity_id}&type=edit`,
})
},
// 查找产品
findEleProduct(){
},
switch1Change(e) {
if(e.type=='change'){
console.log(e)
if (e.detail.value) {
activity_close({
shop_id: this.shop_id,
activity_id: e.currentTarget.dataset.activity_id,
state: 1
}).then(res => {
if (res.code == 0) {
this.$api.msg('活动开启')
}
})
} else {
activity_close({
shop_id: this.shop_id,
activity_id: e.currentTarget.dataset.activity_id,
state: 2
}).then(res => {
if (res.code == 0) {
this.$api.msg('活动关闭')
}
})
}
}else{
return ;
}
},
//交互end
taggletab(index) {
this.tabactive = index;
if (index == 1) {
if (this.start_activity.length == 0) {
activity_select({
shop_id: this.shop_id,
page: 0,
is_date: 2
}).then(res => {
if (res.code == 0) {
this.start_activity = res.data.data
}
})
} else {
return;
}
} else if (index == 2) {
if (this.end_activity.length == 0) {
activity_select({
shop_id: this.shop_id,
page: 0,
is_date: 1
}).then(res => {
if (res.code == 0) {
this.end_activity = res.data.data
}
})
} else {
return;
}
}
},
}
}
</script>
<style lang="scss">
.projuctlist {
margin: 130upx 24upx;
padding-top: 18upx;
background: rgba(255, 255, 255, 1);
border-radius: 14upx;
.itempro {
position: relative;
border-bottom: 1px solid rgba(220, 220, 220, 1);
padding: 20upx;
.thumbnail {
width: 170upx;
height: 170upx;
border-radius: 6upx;
margin-right: 27upx;
margin-left: 20upx;
}
.infobox {
.title {
font-size: 34upx;
color: rgba(51, 51, 51, 1);
//margin-bottom: 5upx;
}
.time {
//margin-bottom: 5upx;
}
.time,
.price {
font-size: 30upx;
color: rgba(153, 153, 153, 1);
}
}
.btnbox {
position: absolute;
bottom: 5px;
right: 5px;
.btns {
width: 100upx;
height: 60upx;
line-height: 60upx;
text-align: center;
border: 1upx solid rgba(160, 160, 160, 1);
border-radius: 4upx;
font-size: 30upx;
color: rgba(0, 0, 0, 1);
}
.btnboxdel {
margin-left: 16upx;
}
.btnboxxj {
background: #FF6900;
color: #FFFFFF;
border: 0;
margin-left: 16upx;
}
}
}
}
.projuctTab {
background: #FFFFFF;
width: 100%;
height: 98upx;
line-height: 98upx;
position: fixed;
top: 0;
/* #ifdef H5 */
top: 86upx;
/* #endif */
left: 0;
z-index: 99;
.tabitems {
text-align: center;
.tabtitle {
text-align: center;
height: 98upx;
line-height: 98upx;
font-size: 30upx;
display: inline-block;
box-sizing: border-box;
color: #333333;
}
}
.tabitems.active {
.tabtitle {
font-family: PingFang SC;
font-weight: bold;
color: #FF6900;
border-bottom: 1px solid #FF6900;
}
}
}
.footchindbox {
width: 100%;
height: 117upx;
background: rgba(255, 255, 255, 1);
padding: 16upx 24upx;
position: fixed;
bottom: 0;
left: 0;
.rightbtn {
.btns {
width: 163upx;
height: 84upx;
line-height: 84upx;
text-align: center;
border: 1px solid rgba(160, 160, 160, 1);
border-radius: 6upx;
color: #000000;
font-size: 35upx;
}
.btns1 {}
.btns2 {
margin-left: 28upx;
background: rgba(255, 102, 0, 1);
color: #FFFFFF;
border: 0;
}
}
}
.submitbtns {
background: #FF6900;
height: 88upx;
line-height: 88upx;
color: #FFFFFF;
text-align: center;
width: 100%;
border-radius: 14upx;
}
</style>
<template>
<view class="productpages" style="margin-top: 20upx;">
<view class="boxcss" style="padding: 30upx">
<view class="littleTitle">
<text>活动时间</text>
</view>
<view class="flex">
<view class="" style="flex:4;text-align: center;margin: auto;background-color:#F0F0F0;height: 60upx;padding: 6upx;" @click="bindDateStartChange(1)">
<input disabled class="inputs" type="text" v-model="form.start_time" placeholder="选择开始时间"/>
</view>
<view class="" style="flex:2;text-align: center;margin: auto;background-color:#fff;height: 60upx;"></view>
<view class="" style="flex:4;text-align: center;margin: auto;background-color:#F0F0F0; height: 60upx;padding: 7upx;" @click="bindDateStartChange(2)">
<input disabled class="inputs" type="text" v-model="form.end_time" placeholder="选择结束时间" />
</view>
</view>
</view>
<view class="boxcss" style="padding: 30upx">
<view class="littleTitle">
<text>填写产品标题</text>
</view>
<view>
<view class="" style="background-color:#F0F0F0;height: 60upx;padding: 6upx;">
<input class="inputs" type="text" v-model="form.title" placeholder="请填写产品标题" />
</view>
</view>
</view>
<view class="boxcss" style="padding: 30upx">
<view class="littleTitle">
<text>分享标题标题</text>
</view>
<view>
<view class="" style="background-color:#F0F0F0;height: 60upx;padding: 6upx;">
<input class="inputs" type="text" v-model="form.share_title" placeholder="分享标题标题" />
</view>
</view>
</view>
<view class="boxcss" style="padding: 30upx">
<view class="littleTitle">
<text>请填写产品领取总份数</text>
</view>
<view>
<view class="" style="background-color:#F0F0F0;height: 60upx;padding: 6upx;">
<input class="inputs" type="number" v-model="form.limit_stock" placeholder="请填写产品领取总份数" />
</view>
</view>
</view>
<view class="boxcss" style="padding: 30upx">
<view class="littleTitle">
<text>填写产品限购购数</text>
</view>
<view>
<view class="" style="background-color:#F0F0F0;height: 60upx;padding: 6upx;">
<input class="inputs" type="number" v-model="form.limit_get" placeholder="请填写产品领取总份数" />
</view>
</view>
</view>
<view style="background-color:#fff;margin:2rpx 0 10rpx 0;padding: 30upx" >
<view style="font-size:30rpx ;font-weight: bold; padding:24rpx 0 60rpx 24rpx;">添加一张分享图</view>
<view style="padding:0 0 24rpx 24rpx;display:flex;flex-wrap:wrap;">
<!-- -->
<view style="height:160rpx;width:160rpx;margin: 0 20rpx 20rpx 0;" v-for=" (item,index) in sharepictureArr">
<image :src="staticUrl + item" style="display: inline;" @click="showshareImg(index)"></image>
<view @click="clearshareImg(index)" style="width: 30rpx;height: 30rpx;background-color: black; color: #fff;line-height: 30rpx;text-align: center;position: relative;border-radius: 30rpx;left: 140rpx;top:-170rpx">
<text>×</text>
</view>
</view>
<view :hidden="!shareshowUpload" style="padding: 1rpx;height:160rpx;width:160rpx" @tap="uploadshareImg">
<image style="display: inline;" src="https://luma.jxdsy.cn/static/applet5/images/slices/addimage.png"></image>
</view>
</view>
</view>
<view style="background-color:#fff;margin:2rpx 0 10rpx 0;padding: 30upx" >
<view style="font-size:30rpx ;font-weight: bold; padding:24rpx 0 60rpx 24rpx;">添加图片</view>
<view style="padding:0 0 24rpx 24rpx;display:flex;flex-wrap:wrap;">
<!-- -->
<view style="height:160rpx;width:160rpx;margin: 0 20rpx 20rpx 0;" v-for=" (item,index) in pictureArr">
<image :src="staticUrl + item" style="display: inline;" @click="showImg(index)"></image>
<view @click="clearImg(index)" style="width: 30rpx;height: 30rpx;background-color: black; color: #fff;line-height: 30rpx;text-align: center;position: relative;border-radius: 30rpx;left: 140rpx;top:-170rpx">
<text>×</text>
</view>
</view>
<!-- 服务器 -->
<!-- <view style="height:160rpx;width:160rpx;margin: 0 20rpx 20rpx 0;" v-for=" (item,index) in uploaderList">
<image :src="item" style="display: inline;" @click="showImg(index)"></image>
<view @click="clearImg(index)" style="width: 30rpx;height: 30rpx;background-color: black; color: #fff;line-height: 30rpx;text-align: center;position: relative;border-radius: 30rpx;left: 140rpx;top:-170rpx">
<text>×</text>
</view>
</view> -->
<view :hidden="!showUpload" style="padding: 1rpx;height:160rpx;width:160rpx" @tap="uploadImg">
<image style="display: inline;" src="https://luma.jxdsy.cn/static/applet5/images/slices/addimage.png"></image>
</view>
</view>
</view>
<view style="text-align:center;height:300upx;background-color: #EEEEEE;">
<button style="top: 35%;width:300upx;color:#fff;background-color: #21B94C;" @tap="publishActivity(publishtype)">确定发布</button>
</view>
<borydateTimePicker
ref='dateTime'
type='datetime'
:datestring='dateString'
@change='dateTimeChange'>
</borydateTimePicker>
</view>
</template>
<script>
import borydateTimePicker from '@/components/bory-dateTimePicker/bory-dateTimePicker.vue'; //时间弹窗
import{activity_add,activity_find,activity_update} from "@/utils/api/merchant.js";
export default {
components:{
borydateTimePicker
},
data() {
return {
shareuploaderList:[],
sharejoinString: '',//上传图片字符
shareimagesrc: '', //上传时后端返回的图片ID,拼接后存入
shareuploaderList: [], //保存上传图片url的数组
shareuploaderNum: 0, //已经上传的图片数目
shareshowUpload: true, //控制上传框的显隐
sharepictureArr: [],//存放上传图片地址
publishopen:true,
publishtype:'',
dateString:'',
joinString: '',//上传图片字符
imagesrc: '', //上传时后端返回的图片ID,拼接后存入
uploaderList: [], //保存上传图片url的数组
uploaderNum: 0, //已经上传的图片数目
showUpload: true, //控制上传框的显隐
pictureArr: [],//存放上传图片地址
publishContent: "", //评论内容
goods_id: '', //商品id
goods_title: '',
is_open:1,
form: {
start_time: '',
end_time: '',
title:'',
limit_stock:'',
limit_get:'',
shop_id:'',
share_title:''
},
}
},
computed: {
staticUrl() {
// https://luma.jxdsy.cn/api/File_upload/uploadify
//静态资源地址
return this.$store.state.staticUrl;
},
staticUrl1() {
return this.$store.state.staticUrl1;
},
},
onLoad(options) {
let that = this
this.activity_id = options.id
this.publishtype = options.type
// console.log(options)
uni.getStorage({
key:'userInfo',
success(res) {
console.log(res)
that.form.shop_id=res.data.shop_id
}
})
if(this.publishtype == 'edit'){
this.activity_find(options.id);
}
},
onShow() {
},
methods: {
/**
* 查询产品
*/
activity_find(activity_id){
console.log('修改')
activity_find({
shop_id:this.$data.shop_id,
activity_id:activity_id
}).then(res=>{
if(res.code == 0){
this.form.start_time = res.data.data.start,
this.form.end_time = res.data.data.end,
this.form.title = res.data.data.goods_name,
this.form.limit_stock = res.data.data.limit_stock,
this.form.limit_get = res.data.data.limit_get,
this.pictureArr = res.data.data.picture,
this.form.share_title = res.data.data.share_title,
this.sharepictureArr[0] = res.data.data.share_pictures
console.log(this.share_title)
if(this.sharepictureArr[0]){
this.shareshowUpload = false
}
if(this.pictureArr.length == 3){
this.showUpload = false
}
}
})
},
publishActivity(e) {
if((!this.form.start_time) || (!this.form.end_time)){
this.$api.msg('开始或结束时间未选择')
return false;
}
if(new Date(this.form.end_time).getTime() <= new Date(this.form.start_time).getTime()){
this.$api.msg('活动开始时间不可以大于结束时间')
return false;
}
if(this.form.title==''){
this.$api.msg('没有填写活动标题')
return false;
}
if(this.form.limit_stock==''){
this.$api.msg('没有填写领取总份数')
return false;
}
if(this.form.share_title==''){
this.$api.msg('没有填写分享标题')
return false;
}
if(this.form.limit_get==''){
this.$api.msg('没有填写限购购数')
return false;
}
if(this.pictureArr.length==0){
this.$api.msg('没有上传图片')
return false;
}
if(this.sharepictureArr.length==0){
this.$api.msg('没有上传分享图')
return false;
}
let picString = '';
for (let index = 0; index < this.pictureArr.length; index++) {
// console.log(this.pictureArr[index])
picString = picString + this.pictureArr[index] + ','
}
picString=picString.slice(0,picString.length-1)
let param = {
start:this.form.start_time, //开始时间
end : this.form.end_time, // 结束时间
limit_stock: this.form.limit_stock,// 领取数量
limit_get:this.form.limit_get, //限购购数
shop_id: this.form.shop_id,// 商家id
goods_name:this.form.title , //商品名称
picture: picString, //商品图片字符串逗哈分割
share_pictures:this.sharepictureArr[0],
share_title:this.form.share_title
}
console.log(this.publishtype , 125215154)
if(this.publishtype == 'edit'){
param.activity_id = this.activity_id
activity_update(param).then(res=>{
if(res.code == 0){
this.$api.msg(res.msg);
setTimeout(()=>{
uni.navigateBack()
},1000)
}
})
}else{
console.log(this.publishopen)
if(this.publishopen){
this.publishopen = false;
console.log(this.publishopen)
activity_add(param).then(res=>{
if(res.code == 0){
this.$api.msg(res.msg);
setTimeout(()=>{
this.publishopen= true;
uni.navigateBack()
},1000)
}
})
}else{
this.$api.msg('不要连续点击')
}
}
},
bindDateStartChange(e) {
this.is_open = e
console.log(e)
this.$refs.dateTime.show()
},
dateTimeChange(dataTime){
if(this.is_open == 1){
this.form.start_time = dataTime
}else if(this.is_open == 2){
this.form.end_time = dataTime
}
},
uploadshareImg:function(e){
let that = this;
uni.chooseImage({
count: 1 - that.shareuploaderNum, // 默认6
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function(res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
that.shareuploaderList.concat(res.tempFilePaths);
let uploaderList = res.tempFilePaths;
// console.log(uploaderList);
uni.showLoading({
title: '图片上传中'
});
that.shareuploaderList = that.shareuploaderList.concat(res.tempFilePaths)
that.shareuploaderNum = that.shareuploaderList.length
let host_url = 'https://luma.jxdsy.cn/api/File_upload/uploadify';
for (let i = 0; i < uploaderList.length; i++) {
uni.uploadFile({
url: host_url,
filePath: uploaderList[i],
name: 'files',
formData: {
files: uploaderList,
},
success: function(res) {
// console.log(res)
let json = res.data;
json = json.replace(/\ufeff/g, "");
let data = JSON.parse(json);
// console.log(data)
that.shareimagesrc = data.data
that.sharepictureArr.push(that.shareimagesrc)
uni.hideLoading()
if (that.sharepictureArr.length == 1) {
that.shareshowUpload = false
}
}
})
// console.log(that.pictureArr)
}
}
})
},
//上传图片
uploadImg: function(e) {
let that = this;
uni.chooseImage({
count: 3 - that.uploaderNum, // 默认6
sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success: function(res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
that.uploaderList.concat(res.tempFilePaths);
let uploaderList = res.tempFilePaths;
// console.log(uploaderList);
uni.showLoading({
title: '图片上传中'
});
that.uploaderList = that.uploaderList.concat(res.tempFilePaths)
that.uploaderNum = that.uploaderList.length
let host_url = 'https://luma.jxdsy.cn/api/File_upload/uploadify';
for (let i = 0; i < uploaderList.length; i++) {
uni.uploadFile({
url: host_url,
filePath: uploaderList[i],
name: 'files',
formData: {
files: uploaderList,
},
success: function(res) {
// console.log(res)
let json = res.data;
json = json.replace(/\ufeff/g, "");
let data = JSON.parse(json);
// console.log(data)
that.imagesrc = data.data
that.pictureArr.push(that.imagesrc)
uni.hideLoading()
if (that.pictureArr.length == 3) {
that.showUpload = false
}
}
})
// console.log(that.pictureArr)
}
}
})
},
// 删除图片
clearImg: function (index) {
var that = this
// var nowList = []; //新数据
// var pictureArr = that.pictureArr; //原数据
that.pictureArr.splice(index,1);
that.uploaderNum = that.uploaderNum - 1
// uploaderList: nowList,
that.showUpload= true
},
// 删除图片
clearshareImg: function (index) {
var that = this
// var nowList = []; //新数据
// var pictureArr = that.pictureArr; //原数据
that.sharepictureArr.splice(index,1);
that.shareuploaderNum = that.shareuploaderNum - 1
// uploaderList: nowList,
that.shareshowUpload= true
},
showImg(index){
var imgArr = this.pictureArr.map((value, index) => {
return "https://luma.jxdsy.cn/attachs/" + value
})
let url = imgArr[index]
uni.previewImage({
current: url,
urls: imgArr,
})
},
showshareImg(index){
var imgArr = this.sharepictureArr.map((value, index) => {
return "https://luma.jxdsy.cn/attachs/" + value
})
let url = imgArr[index]
uni.previewImage({
current: url,
urls: imgArr,
})
}
// }
}
}
</script>
<style>
.productpages {
background: #FFFFFF;
/* padding: 30upx; */
width: 100%;
}
.inputs {
border: ;
}
.showUpload {
display: none;
}
.littleTitle {
font-size: 30upx;
font-weight: bold;
padding: 20upx 0;
}
.boxcss{
padding: 20upx 0 ;
}
</style>
static/icon/20.png

4.24 KB | W: | H:

static/icon/20.png

1.81 KB | W: | H:

static/icon/20.png
static/icon/20.png
static/icon/20.png
static/icon/20.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -300,12 +300,22 @@ export function orderList(data) ...@@ -300,12 +300,22 @@ export function orderList(data)
return request.post("order/orderList",data,{ noAuth : true}); return request.post("order/orderList",data,{ noAuth : true});
} }
// 商城退款/售后列表(新接口)
export function getRefundOrderList(data) {
return request.post("RefundOrder/getRefundOrderList",data, { noAuth: false });
}
//商城订单详情 //商城订单详情
export function orderDetails(data) export function orderDetails(data)
{ {
return request.post("order/orderDetails",data,{ noAuth : true}); return request.post("order/orderDetails",data,{ noAuth : true});
} }
// 商城退款/售后订单详情页面(新接口)
export function getRefundDetail(data) {
return request.post("RefundOrder/getRefundDetail",data, { noAuth: false });
}
//商城订单一键核销 //商城订单一键核销
export function oneKeyCancel(data) export function oneKeyCancel(data)
{ {
...@@ -331,6 +341,26 @@ export function checkLogistics(data) ...@@ -331,6 +341,26 @@ export function checkLogistics(data)
return request.post("order/checkLogistics",data,{ noAuth : true}); return request.post("order/checkLogistics",data,{ noAuth : true});
} }
// 商城退款/售后 查看物流
export function viewLogistics(data) {
return request.post("RefundOrder/viewLogistics",data, { noAuth: false });
}
// 商城退款/售后 确认收货
export function setReceivingGoods(data) {
return request.post("RefundOrder/setReceivingGoods",data, { noAuth: false });
}
// 商城退款/售后 商家审核
export function shopExamine(data) {
return request.post("RefundOrder/shopExamine",data, { noAuth: false });
}
// 商城退款/售后 立即发货
export function setDeliverGoods(data) {
return request.post("RefundOrder/setDeliverGoods",data, { noAuth: false });
}
//商城订单同意退款 //商城订单同意退款
export function consentRefund(data) export function consentRefund(data)
{ {
......
...@@ -47,6 +47,60 @@ export function getshopclass(data){ ...@@ -47,6 +47,60 @@ export function getshopclass(data){
} }
/**
* @param {Object} data
*/
//获取分类 列表
export function activity_nucleus(data){
return request.post("/ele/activity_nucleus", data, { noAuth: true});
}
/**
* 添加免费领东西活动
* @param {Object} data
*/
export function activity_add(data){
return request.post("/ele/activity_add", data, { noAuth: true});
}
/**
* 获取活动列表
* @param {Object} data
*/
export function activity_select(data){
return request.post("/ele/activity_select", data, { noAuth: true});
}
/**
* 关闭活动
* @param {Object} data
*/
export function activity_close(data){
return request.post("/ele/activity_close", data, { noAuth: true});
}
/**
* 活动详情
* @param {} data
*/
export function activity_find(data){
return request.post("/ele/activity_find", data, { noAuth: true});
}
/**
*
* @param {} data
*/
export function activity_user(data){
return request.post("/ele/activity_user", data, { noAuth: true});
}
/**
* 修改活动
* @param {} data
*/
export function activity_update(data){
return request.post("/ele/activity_update", data, { noAuth: true});
}
\ No newline at end of file
...@@ -3,19 +3,13 @@ ...@@ -3,19 +3,13 @@
module.exports = { module.exports = {
//是否为开发调试环境 true为本地环境 false 为正式环境 //是否为开发调试环境 true为本地环境 false 为正式环境
// isdebug:false,//正式
// isdebug:false,//正式
isdebug:true,//测试 isdebug:true,//测试
// xqdebug:false,//正式权限
xqdebug:false,//正式权限 xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
// xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
// #ifdef APP-PLUS
// isdebug:false,//正式 APP里面绝对是正式
// #endif
/** /**
* PS * PS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment