Merge branch 'feature-releaseGoods' into pre-release

# Conflicts:
#	config/app.js
#	manifest.json
#	pages.json
#	pages/chat/customer_list/index.vue
#	pages/index/index.vue
#	pages/product/addGood/addGood.vue
#	pages/product/basicSet.vue
#	pages/product/list/index.vue
#	pages/users/gather_list/index.vue
#	pages/withdrawal/index.vue
#	pages/withdrawal/progress.vue
#	uni_modules/h-datetime-picker/components/h-datetime-picker/h-datetime-picker.vue
#	utils/util.js
This commit is contained in:
luofei 2024-05-14 17:59:48 +08:00
commit a6c5f9581a
65 changed files with 12365 additions and 5336 deletions

31
App.vue
View File

@ -1,6 +1,6 @@
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
@ -16,7 +16,9 @@
checkLogin
} from "./libs/login";
import {
getUserInfo
} from '@/api/user.js';
import {
parseToken
@ -65,7 +67,6 @@
auto_arrival: 0,
mer_location: 0,
statusBarHeight: 0,
mer_location: 0,
store_street_theme: 1,
sys_intention_agree: '',
copyright_status: '',
@ -89,6 +90,21 @@
//
console.log('消息成功' + JSON.stringify(option));
});
uni.onHostEventReceive((event, data) => {
if (event == 'tocustomlist') {
if (data.page_type == 1) {
uni.switchTab({
url: data.route
});
} else {
uni.navigateTo({
url: data.route
})
}
}
});
// #endif
this.globalData.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
@ -120,6 +136,10 @@
if (option?.referrerInfo?.extraData?.uniMP) {
uni.setStorageSync('uniMP', option.referrerInfo?.extraData?.uniMP);
// this.$store.commit("LOGIN", {
// 'token': option.referrerInfo?.extraData?.token,
// 'time': 604800
// });
parseToken({
token: option.referrerInfo?.extraData?.token
}).then((res) => {
@ -133,6 +153,7 @@
'token': option.referrerInfo?.extraData?.token,
'time': 604800
});
console.log('TOKEN解析错误:', err);
this.$isResolve()
})
} else {
@ -436,12 +457,6 @@
box-sizing: border-box;
}
.c_active {
&:active {
opacity: .8;
}
}
.custom_style {
color: #fff;
display: flex;

34
api/common.js Normal file
View File

@ -0,0 +1,34 @@
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import request from "@/utils/request.js";
/**
* 获取省份
*/
export function getProvince() {
return request.get("city/get_province");
}
/**
* 获取省份
*/
export function getCity(data) {
return request.get("city/get_city", data);
}
/**
* 获取省份
*/
export function getArea(data) {
return request.get("city/get_area", data);
}

View File

@ -147,6 +147,35 @@ export function categoryList(merId) {
})
}
/*
添加修改商品 搜索上平
*/
export function categorySearch(merId, data) {
return request.get(`server/${merId}/category/search`, data, {
login: true
})
}
/*
添加修改商品 热门分类商品
*/
export function categorySearchHistory(merId, uid, data) {
return request.post(`server/${merId}/category/search_history/${uid}`, data, {
login: true
})
}
/*
添加修改商品 添加热门分类商品
*/
export function categoryHotcate(merId, uid) {
return request.get(`server/${merId}/category/hotcate/${uid}`, {
login: true
})
}
/*
商品管理 添加商品
*/

View File

@ -19,7 +19,13 @@ export function errorReport(data) {
return request.post(`api/err/report`, data);
}
/**
* 新商户
*/
export function isNewMer(uid, mer_id, data) {
return request.post(`auth/guide/${uid}/${mer_id}`, data);
}
/**
/**
* 提现----查询单条信息
*/

View File

@ -44,8 +44,9 @@
<view class='text'>
<view class='name line2'>{{item.store_name}}</view>
<view class="score"><span
style="font-size: 23rpx;font-family: PingFang SC-Semibold, PingFang SC;font-weight: 600;color: #F84221;margin-right: 28rpx;">{{item.rate}}</span>
{{item.reply_count}}条评论</view>
style="font-size: 23rpx;font-weight: 600;color: #F84221;margin-right: 28rpx;">{{item.rate}}</span>
{{item.reply_count}}条评论
</view>
<view class="" style="display: flex;justify-content: space-between;">
<view class='money'>
<span style="font-size:30rpx;"></span>

View File

@ -84,7 +84,6 @@
.title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
margin: 12px 0;
@ -110,7 +109,6 @@
border-radius: 11rpx 11rpx 11rpx 11rpx;
border: 1px solid #3274F9;
font-size: 19rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-right: 15rpx;
}
@ -125,7 +123,6 @@
border-radius: 11rpx 0px 0px 0rpx;
border: 1px solid #F84221;
font-size: 19rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
@ -136,7 +133,6 @@
border-radius: 0px 11rpx 11rpx 0px;
border: 1px solid #F84221;
font-size: 19rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
}
@ -161,7 +157,6 @@
.relase-two {
font-size: 23rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 500;
color: #B3B3B3;
margin-left: 13rpx;
@ -201,7 +196,6 @@
opacity: 1;
font-size: 23rpx;
padding-left: 11rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #737373;

View File

@ -94,7 +94,6 @@
.title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
margin: 12px 0;

View File

@ -44,8 +44,9 @@
<view class='text'>
<view class='name line2'>{{item.store_name}}</view>
<view class="score"><span
style="font-size: 23rpx;font-family: PingFang SC-Semibold, PingFang SC;font-weight: 600;color: #F84221;margin-right: 28rpx;">{{item.rate}}</span>
{{item.reply_count}}条评论</view>
style="font-size: 23rpx;font-weight: 600;color: #F84221;margin-right: 28rpx;">{{item.rate}}</span>
{{item.reply_count}}条评论
</view>
<view class="" style="display: flex;justify-content: space-between;">
<view class='money'>
<span style="font-size:30rpx;"></span>

View File

@ -84,7 +84,6 @@
.title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
margin: 12px 0;
@ -110,7 +109,6 @@
border-radius: 11rpx 11rpx 11rpx 11rpx;
border: 1px solid #3274F9;
font-size: 19rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-right: 15rpx;
}
@ -125,7 +123,6 @@
border-radius: 11rpx 0px 0px 0rpx;
border: 1px solid #F84221;
font-size: 19rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
@ -136,7 +133,6 @@
border-radius: 0px 11rpx 11rpx 0px;
border: 1px solid #F84221;
font-size: 19rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
}
@ -161,7 +157,6 @@
.relase-two {
font-size: 23rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 500;
color: #B3B3B3;
margin-left: 13rpx;
@ -201,7 +196,6 @@
opacity: 1;
font-size: 23rpx;
padding-left: 11rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #737373;

View File

@ -94,7 +94,6 @@
.title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
margin: 12px 0;

BIN
components/aaa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -55,8 +55,6 @@
font-size: 30rpx;
font-family: PingFang SC-Regular,
PingFang SC;
font-weight: 400;
color: #333333;
}

View File

@ -38,7 +38,9 @@
// #ifdef H5
import ClipboardJS from "@/plugin/clipboard/clipboard.js";
// #endif
import { mapGetters } from "vuex";
import {
mapGetters
} from "vuex";
export default {
props: {
isCopy: {
@ -81,7 +83,9 @@
//#ifndef H5
copyText: function() {
let that = this;
uni.setClipboardData({ data: this.copyUrl });
uni.setClipboardData({
data: this.copyUrl
});
setTimeout(() => {
that.$emit('close');
}, 500)
@ -106,12 +110,14 @@
transform: translate3d(0, 100%, 0);
transition: all .1s cubic-bezier(.25, .5, .5, .9);
padding: 50rpx 30rpx 30rpx;
.icon-guanbi {
position: absolute;
top: 20rpx;
right: 20rpx;
color: #8A8A8A;
}
.button {
height: 76rpx;
border-radius: 38rpx;
@ -122,21 +128,24 @@
color: #FFFFFF;
}
}
.copy-list-window.on {
transform: translate3d(0, 0, 0);
}
.copy-list-window .title {
width: 100%;
text-align: center;
font-size: 32rpx;
font-weight: bold;
font-family: 'PingFang SC';
.iconfont {
font-size: 30rpx;
color: #FBB324;
margin-right: 12rpx;
}
}
.copy-url {
margin-top: 30rpx;
background: #F5F5F5;

View File

@ -78,7 +78,6 @@
padding-right: 0rpx;
scroll-behavior: smooth; //
font-size: 32rpx;
font-family: PingFang-SC-Heavy;
.my-tab-item {
padding: 20rpx 35rpx; // --
@ -89,7 +88,6 @@
&.active {
color: #333333; // --
font-family: PingFang-SC-Heavy;
font-weight: 600;
position: relative;
@ -110,7 +108,6 @@
position: relative;
z-index: 9;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #F84221;
color: #F84221;

View File

@ -1,11 +1,12 @@
<template>
<view class='product-bg'>
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay" :circular="circular"
:interval="interval" :duration="duration" @change="change" v-if="isPlay">
<swiper :indicator-dots="indicatorDots" indicator-active-color="#e93323" :autoplay="autoplay"
:circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS -->
<swiper-item v-if="videoline && videoline != '' && videoline != 'https:'">
<view class="item">
<video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : ("http:" + videoline)'
<video id="myVideo"
:src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : ("http:" + videoline)'
objectFit="cover" controls style="width:100%;height:100% " show-mute-btn="true"
auto-pause-if-navigate @ended="endedFun()"></video>
<view class="poster" v-if="controls">
@ -37,9 +38,11 @@
</swiper>
<!-- #ifdef APP-PLUS -->
<view v-if="!isPlay" style="width: 100%; height: 750rpx;">
<video id="myVideo" :src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : "http:" + videoline'
<video id="myVideo"
:src='videoline && (videoline.substring(0,4) == "http" || videoline.substring(0,5) == "https") ? videoline : "http:" + videoline'
objectFit="cover" controls style="width:100%;height:100% " show-center-play-btn show-mute-btn="true"
auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause" @ended="endedFun()"></video>
auto-pause-if-navigate :enable-progress-gesture="false" :poster="videoCoverImg" @pause="videoPause"
@ended="endedFun()"></video>
</view>
<!-- #endif -->
@ -140,15 +143,18 @@
height: 750rpx;
position: relative;
}
.product-bg swiper {
width: 100%;
height: 100%;
position: relative;
}
.product-bg .slide-image {
width: 100%;
height: 100%;
}
.product-bg .pages {
position: absolute;
background-color: #fff;
@ -161,15 +167,18 @@
font-size: 24rpx;
color: #050505;
}
#myVideo {
width: 100%;
height: 100%
}
.product-bg .item {
position: relative;
width: 100%;
height: 100%;
}
.product-bg .item .poster {
position: absolute;
top: 0;
@ -178,10 +187,12 @@
width: 100%;
z-index: 9;
}
.product-bg .item .poster .image {
width: 100%;
height: 100%;
}
.product-bg .item .stop {
position: absolute;
top: 50%;
@ -192,6 +203,7 @@
margin-left: -68rpx;
z-index: 9;
}
.product-bg .item .stop .image {
width: 100%;
height: 100%;

View File

@ -0,0 +1,239 @@
<template>
<view class='product-bg'>
<swiper :indicator-dots="indicatorDots" :current='current' indicator-active-color="#e93323" :autoplay="autoplay"
:circular="circular" :interval="interval" :duration="duration" @change="change" v-if="isPlay">
<!-- #ifndef APP-PLUS -->
<block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item v-if="isVideoUrl(item)">
<video :src="isVideoUrl(item,true)" objectFit="cover" controls style="width:100%;height:100% "
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate
:enable-progress-gesture="false" :poster="item+coverUrl"></video>
</swiper-item>
<swiper-item v-else>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' />
</swiper-item>
</block>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<block v-for="(item,index) in imgUrls" :key='index'>
<swiper-item v-if="isVideoUrl(item)">
<view>
<image :src="item+coverUrl" class="slide-image" />
<image class="image-play-icon" src="../../static/images/stop.png"
@click='videoPlay(item,index)'>
</image>
</view>
</swiper-item>
<swiper-item v-else>
<image :src="item" class="slide-image" @click='getpreviewImage(item)' />
</swiper-item>
</block>
<!-- #endif -->
</swiper>
<!-- #ifdef APP-PLUS -->
<view v-if="!isPlay" style="width: 100%; height: 750rpx;">
<video id="myVideo" :src='playingUrl' objectFit="cover" controls style="width:100%;height:100% "
show-center-play-btn show-mute-btn="true" auto-pause-if-navigate :enable-progress-gesture="false"
:poster="playingUrl+coverUrl" @pause="videoPause" @ended="endedFun()"></video>
</view>
<!-- #endif -->
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
export default {
props: {
imgUrls: {
type: Array,
default: function() {
return [];
}
},
videoline: {
type: String,
value: ""
},
videoCoverImg: {
type: String,
}
},
data() {
return {
coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
current: '0',
videoTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
playingUrl: '',
indicatorDots: true,
circular: true,
autoplay: true,
interval: 5000,
duration: 500,
currents: "1",
controls: true,
isPlay: true,
videoContext: ''
};
},
created() {
},
watch: {
},
mounted() {
// #ifndef APP-PLUS
this.videoContext = uni.createVideoContext('myVideo', this);
// #endif
},
methods: {
isVideoUrl(url, getRightUrl) {
const str = url;
const lastIndex = str.lastIndexOf(".");
let extension;
if (lastIndex !== -1) {
extension = str.substring(lastIndex + 1);
} else {
extension = 'jpg'
}
if (getRightUrl) return url.replace(/\\/g, "")
return this.videoTypeList.includes(extension)
},
videoPlay(url, index) {
this.playingUrl = url
this.current = index
console.log(this.current)
this.bindPause()
},
getpreviewImage: function(item) {
uni.previewImage({
urls: this.imgUrls,
current: item
});
},
videoPause(e) {
// #ifdef APP-PLUS
this.isPlay = true
this.autoplay = true
// #endif
},
bindPause: function() {
// #ifndef APP-PLUS
this.videoContext.play();
this.$set(this, 'controls', false)
this.autoplay = false
// #endif
// #ifdef APP-PLUS
this.isPlay = false
this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(() => {
this.videoContext.play();
})
// #endif
},
change: function(e) {
this.$set(this, 'currents', e.detail.current + 1);
},
endedFun() {
this.controls = true
}
}
}
</script>
<style scoped lang="scss">
.product-bg {
width: 100%;
height: 750rpx;
position: relative;
}
.product-bg swiper {
width: 100%;
height: 100%;
position: relative;
}
.product-bg .slide-image {
width: 750rpx;
height: 750rpx;
}
.product-bg .pages {
position: absolute;
background-color: #fff;
height: 34rpx;
padding: 0 10rpx;
border-radius: 3rpx;
right: 30rpx;
bottom: 30rpx;
line-height: 34rpx;
font-size: 24rpx;
color: #050505;
}
#myVideo {
width: 100%;
height: 100%
}
.product-bg .item {
position: relative;
width: 100%;
height: 100%;
}
.product-bg .item .poster {
position: absolute;
top: 0;
left: 0;
height: 750rpx;
width: 100%;
z-index: 9;
}
.product-bg .item .poster .image {
width: 100%;
height: 100%;
}
.product-bg .item .stop {
position: absolute;
top: 50%;
left: 50%;
width: 136rpx;
height: 136rpx;
margin-top: -68rpx;
margin-left: -68rpx;
z-index: 9;
}
.product-bg .item .stop .image {
width: 100%;
height: 100%;
}
.image-play-icon {
position: absolute;
width: 100rpx;
height: 100rpx;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>

View File

@ -0,0 +1,466 @@
<template>
<view :style="viewColor">
<view class="product-window"
:class="(attr.cartAttr === true ? 'on' : '') + ' ' + (iSbnt || destri?'join':'') + ' ' + (isPresell ?'presell-window':'product-window')">
<view class="textpic acea-row row-between-wrapper">
<view class="pictrue">
<image :src="attr.productSelect.image ? attr.productSelect.image : image" @click="loookImg"></image>
</view>
<view class="text">
<view class="line1">
{{ attr.productSelect.store_name }}
</view>
<view v-if="isPresell" class="money presell_price">
<view>
预售价
<text class="num">{{ attr.productSelect.price }}</text>
<text v-if="presell_type === 2">定金<text
class="num">{{ attr.productSelect.down_price }}</text></text>
</view>
<text class="stock" v-if='isShow'>库存: {{ attr.productSelect.stock }}</text>
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
</view>
<view v-else class="money">
<view class="acea-row row-middle">
<view class="acea-row row-middle">
<text></text><text class="num">{{ attr.productSelect.price }}</text>
<view v-if="svipPrice" class="acea-row row-middle">
<text class='vip-money'>{{attr.productSelect.svip_price}}</text>
<view class="vipImg">
<image src="/static/images/svip.png"></image>
</view>
</view>
</view>
</view>
<view class="stock_count">
<text class="stock" v-if='isShow'>库12存: {{ attr.productSelect.stock }}</text>
<text class='stock' v-if="limitNum">限量: {{attr.productSelect.quota_show}}</text>
</view>
</view>
</view>
<view class="iconfont icon-guanbi" @click="closeAttr"></view>
</view>
<view class="productWinList">
<view class="item" v-for="(item, indexw) in attr.productAttr" :key="indexw">
<view class="title">{{ item.attr_name }}</view>
<view class="listn acea-row row-middle">
<view class="itemn" :class="item.index === itemn.attr ? 'on' : ''"
v-for="(itemn, indexn) in item.attr_value" @click="tapAttr(indexw, indexn)" :key="indexn">
{{ itemn.attr }}
</view>
</view>
</view>
</view>
<view class="cart acea-row">
<view class="title">数量</view>
<view class="carnum acea-row row-left">
<view class="buy_limit" v-if="minCount>0 || maxCount>0">
(<text v-if="minCount>0">{{minCount}}件起购<text
v-if="minCount>0 && maxCount>0"></text></text><text
v-if="maxCount>0">最多{{maxCount}}</text>)
</view>
<view class="item reduce" :class="attr.productSelect.cart_num <= 1 ? 'on' : ''" @click="CartNumDes">
-
</view>
<view class='item num'>
<input type="number" v-model="attr.productSelect.cart_num" data-name="productSelect.cart_num"
@input="bindCode(attr.productSelect.cart_num)" @keydown="btKeyDown"
@keyup="btKeyUp"></input>
</view>
<view v-if="iSplus" class="item plus"
:class=" attr.productSelect.cart_num >= attr.productSelect.stock || destri ? 'on' : ''"
@click="CartNumAdd">+</view>
<view v-else class='item plus' :class='(attr.productSelect.cart_num >= attr.productSelect.quota_show)
|| (attr.productSelect.cart_num >= attr.productSelect.product_stock)? "on":""' @click='CartNumAdd'>+
</view>
</view>
</view>
<view class="joinBnt b-color" v-if="destri && attr.productSelect.stock>0" @click="goCat">立即购买</view>
<view class="joinBnt on" v-else-if="destri && attr.productSelect.stock<=0">已售罄</view>
<view class="joinBnt b-color" v-if="iSbnt && attr.productSelect.stock>0" @click="goCat">我要参团</view>
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.stock<=0)">已售罄</view>
</view>
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
</view>
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEBCRMEB
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import {
mapGetters
} from "vuex";
export default {
props: {
attr: {
type: Object,
default: () => {}
},
limitNum: {
type: Number,
value: 0
},
isShow: {
type: Number,
value: 0
},
iSbnt: {
type: Number,
value: 0
},
iSplus: {
type: Number,
value: 0
},
destri: {
type: Number,
value: 0
},
isPresell: {
type: Number,
value: 0
},
presell_type: {
type: Number,
value: 1
},
image: {
type: String,
value: ''
},
maxCount: {
type: Number,
value: 0
},
minCount: {
type: Number,
value: 0
},
svipPrice: {
type: Boolean,
value: false
}
},
computed: mapGetters(['viewColor']),
data() {
return {};
},
mounted() {
console.log(this.attr, 'attr')
},
methods: {
//
loookImg() {
let self = this
let arr = [self.attr.productSelect.image ? self.attr.productSelect.image : self.image]
uni.previewImage({
urls: arr,
});
},
goCat: function() {
this.$emit('goCat');
},
/**
* 购物车手动输入数量
*
*/
bindCode: function(e) {
let num = JSON.parse(JSON.stringify(e))
this.$emit('iptCartNum', num);
},
btKeyDown(e) {
e.target.value = e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g, "");
},
btKeyUp(e) {
e.target.value = e.target.value.replace(
/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g, "")
},
closeAttr: function() {
this.$emit('myevent');
},
CartNumDes: function() {
if (!this.destri) {
this.$emit('ChangeCartNum', false);
}
},
CartNumAdd: function() {
if (!this.destri) {
this.$emit('ChangeCartNum', true);
}
},
tapAttr: function(indexw, indexn) {
let that = this;
that.$emit("attrVal", {
indexw: indexw,
indexn: indexn
});
this.$set(this.attr.productAttr[indexw], 'index', this.attr.productAttr[indexw].attr_values[indexn]);
let value = that.getCheckedValue().join(",");
that.$emit("ChangeAttr", value);
},
//
getCheckedValue: function() {
let productAttr = this.attr.productAttr;
let value = [];
for (let i = 0; i < productAttr.length; i++) {
for (let j = 0; j < productAttr[i].attr_values.length; j++) {
if (productAttr[i].index === productAttr[i].attr_values[j]) {
value.push(productAttr[i].attr_values[j]);
}
}
}
return value;
}
}
}
</script>
<style scoped lang="scss">
.product-window {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
background-color: #fff;
z-index: 77;
border-radius: 16rpx 16rpx 0 0;
padding-bottom: 140rpx;
padding-bottom: calc(140rpx+ constant(safe-area-inset-bottom)); /// IOS<11.2/
padding-bottom: calc(140rpx + env(safe-area-inset-bottom)); /// IOS>11.2/
transform: translate3d(0, 100%, 0);
transition: all .3s cubic-bezier(.25, .5, .5, .9);
&.presell-window {
padding-bottom: 200rpx;
}
}
.product-window.on {
transform: translate3d(0, 0, 0);
}
.product-window.join {
padding-bottom: 30rpx;
}
.product-window .textpic {
padding: 0 80rpx 0 30rpx;
margin-top: 29rpx;
position: relative;
}
.product-window .textpic .pictrue {
width: 150rpx;
height: 150rpx;
}
.product-window .textpic .pictrue image {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
.product-window .textpic .text {
width: 460rpx;
font-size: 32rpx;
color: #202020;
}
.product-window .textpic .text .money {
font-size: 24rpx;
margin-top: 26rpx;
font-weight: 700;
color: var(--view-priceColor);
}
.product-window .stock_count {
margin-top: 5rpx;
}
.product-window .textpic .text .money .num {
font-size: 36rpx;
}
.product-window .textpic .text .money .stock {
color: #999;
margin-left: 18rpx;
font-weight: normal;
}
.product-window .textpic .text .presell_price {
color: #FF7F00;
.num {
display: inline-block;
margin-right: 20rpx;
}
.stock {
margin-left: 0;
}
}
.vip-money {
color: #282828;
font-size: 22rpx;
margin-left: 6rpx;
}
.vipImg {
width: 65rpx;
height: 28rpx;
margin-left: 4rpx;
image {
width: 100%;
height: 100%;
display: block;
}
}
.product-window .textpic .iconfont {
position: absolute;
right: 30rpx;
top: -5rpx;
font-size: 35rpx;
color: #8a8a8a;
}
.product-window .productWinList {
max-height: 395rpx;
overflow: auto;
margin-top: 36rpx;
}
.product-window .productWinList .item~.item {
margin-top: 36rpx;
}
.product-window .productWinList .item .title {
font-size: 30rpx;
color: #999;
padding: 0 30rpx;
}
.product-window .productWinList .item .listn {
padding: 0 30rpx 0 16rpx;
}
.product-window .productWinList .item .listn .itemn {
border: 1px solid #bbb;
font-size: 26rpx;
color: #282828;
padding: 7rpx 33rpx;
border-radius: 6rpx;
margin: 14rpx 0 0 14rpx;
}
.product-window .productWinList .item .listn .itemn.on {
color: #fff;
background-color: var(--view-theme);
border-color: var(--view-theme);
}
.product-window .cart {
margin-top: 36rpx;
padding: 0 30rpx;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: justify;
-webkit-justify-content: space-between;
-ms-flex-pack: justify;
justify-content: space-between;
}
.product-window .cart .title {
font-size: 30rpx;
color: #999;
line-height: 54rpx;
}
.product-window .cart .carnum {
height: 54rpx;
align-items: center;
}
.product-window .cart .carnum .buy_limit {
font-size: 22rpx;
color: var(--view-theme);
margin-right: 30rpx;
}
.product-window .cart .carnum .item {
width: 63rpx;
text-align: center;
height: 100%;
line-height: 42rpx;
color: #333333;
font-weight: 400;
font-size: 26rpx;
}
.product-window .cart .carnum .reduce {
border: 1px solid #a4a4a4;
width: 44rpx;
height: 42rpx;
// border-right: 0;
border-radius: 0 7rpx 7rpx 0;
line-height: 30rpx;
}
.product-window .cart .carnum .reduce.on {
border-color: #e3e3e3;
color: #dedede;
}
.product-window .cart .carnum .plus {
border: 1px solid #a4a4a4;
width: 44rpx;
height: 42rpx;
// border-right: 0;
border-radius: 0 7rpx 7rpx 0;
line-height: 30rpx
}
.product-window .cart .carnum .plus.on {
border-color: #e3e3e3;
color: #dedede;
}
.product-window .cart .carnum .num {
color: #282828;
font-size: 28rpx;
}
.product-window .joinBnt {
font-size: 30rpx;
width: 620rpx;
height: 86rpx;
border-radius: 50rpx;
text-align: center;
line-height: 86rpx;
color: #fff;
margin: 21rpx auto 0 auto;
&.b-color {
background-color: var(--view-theme);
}
}
.product-window .joinBnt.on {
background-color: #bbb;
color: #fff;
}
</style>

View File

@ -483,7 +483,6 @@
line-height: 60rpx;
text-align: center;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #959595;
background-color: #E7E6E4;
@ -512,9 +511,7 @@
background: #F5F5F5;
border-radius: 7rpx 7rpx 7rpx 7rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-left: 20rpx;

View File

@ -163,14 +163,12 @@
.title1 {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
}
.title2 {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
margin-top: 11rpx;

View File

@ -456,7 +456,6 @@
line-height: 60rpx;
text-align: center;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #959595;
background-color: #E7E6E4;
@ -485,7 +484,6 @@
background: #F5F5F5;
border-radius: 7rpx 7rpx 7rpx 7rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
margin-left: 20rpx;

View File

@ -4,7 +4,8 @@
<view class="pop">
<scroll-view scroll-y class="scroll">
<view class="image">
<swiper class="swiper" :current="current" autoplay style="width: 100%;height: 100%;" @change="changeCurrent">
<swiper class="swiper" :current="current" autoplay style="width: 100%;height: 100%;"
@change="changeCurrent">
<block v-if="product.slider_image && product.slider_image.length>0">
<swiper-item v-for="(item,index) in product.slider_image" :key="index">
<image class="img" :src="item" :lazy-load="true"></image>
@ -14,7 +15,8 @@
<image class="img" :src="datas.image||defualtImg"></image>
</swiper-item>
</swiper>
<view class="current">{{current+1}}/{{product.slider_image && product.slider_image.length||1}}</view>
<view class="current">{{current+1}}/{{product.slider_image && product.slider_image.length||1}}
</view>
<image class="close" src="@/static/images/icon/close.png" @click="close()"></image>
<view class="border"></view>
</view>
@ -49,17 +51,20 @@
({{once_min_count}}件起购)
</view>
<view class="input_item sub" @click="subCartNum">-</view>
<input class="input_item input_view" v-model="cart_num" type="number" @input="inputCartNum" @blur="inputCartNumBlur" />
<input class="input_item input_view" v-model="cart_num" type="number"
@input="inputCartNum" @blur="inputCartNumBlur" />
<view class="input_item plus" @click="plusCartNum">+</view>
</view>
</view>
<view>
商品库存 <text style="margin-left: 20rpx;">{{sku[changeSkuKey] ? sku[changeSkuKey].stock : change.stock}}</text>
商品库存 <text
style="margin-left: 20rpx;">{{sku[changeSkuKey] ? sku[changeSkuKey].stock : change.stock}}</text>
</view>
</view>
</scroll-view>
<view class="button">
<view class="b_icon" @click="navgo(source==12 ? '/pages/nongKe/supply_chain/shopping_trolley_other?source='+source : '/pages/nongKe/supply_chain/shopping_trolley_a')">
<view class="b_icon"
@click="navgo(source==12 ? '/pages/nongKe/supply_chain/shopping_trolley_other?source='+source : '/pages/nongKe/supply_chain/shopping_trolley_a')">
<image src="@/static/images/icon/car.png"></image>
<view>采购车</view>
<view class="badge" v-if="goodsNum">
@ -79,7 +84,9 @@
postCartAdd,
getProductDetail
} from '@/api/store.js';
import { Toast } from '../libs/uniApi';
import {
Toast
} from '../libs/uniApi';
export default {
name: "shortPopup",
props: {
@ -115,8 +122,7 @@
once_min_count: 1, //
};
},
mounted() {
},
mounted() {},
computed: {
leftPrice() {
return this.sku[this.changeSkuKey]?.wholesale_price?.split('.')[0] || '0';
@ -340,7 +346,6 @@
text-align: center;
color: #fff;
font-size: 26rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
}
@ -392,7 +397,6 @@
.short_name {
font-size: 33rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #333333;
}
@ -415,7 +419,6 @@
.m_title {
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 31rpx;
@ -543,7 +546,6 @@
justify-content: center;
align-items: center;
font-size: 30rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}

View File

@ -163,6 +163,134 @@
"splashscreen" : {
"useOriginalMsgbox" : true
}
},
"nativePlugins" : {
"JG-JCore" : {
"JPUSH_APPKEY_IOS" : "",
"JPUSH_CHANNEL_IOS" : "",
"JPUSH_APPKEY_ANDROID" : "",
"JPUSH_CHANNEL_ANDROID" : "",
"__plugin_info__" : {
"name" : "JG-JCore",
"description" : "极光推送JCore插件",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {
"JPUSH_APPKEY_IOS" : {
"des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"key" : "JCore:APP_KEY",
"value" : ""
},
"JPUSH_CHANNEL_IOS" : {
"des" : "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"key" : "JCore:CHANNEL",
"value" : ""
},
"JPUSH_APPKEY_ANDROID" : {
"des" : "[Android]极光portal配置应用信息时分配的AppKey",
"key" : "JPUSH_APPKEY",
"value" : ""
},
"JPUSH_CHANNEL_ANDROID" : {
"des" : "[Android]用于统计分发渠道不需要可填默认值developer-default",
"key" : "JPUSH_CHANNEL",
"value" : ""
}
}
}
},
"JG-JPush" : {
"JPUSH_ISPRODUCTION_IOS" : "",
"JPUSH_ADVERTISINGID_IOS" : "",
"JPUSH_DEFAULTINITJPUSH_IOS" : "",
"JPUSH_OPPO_APPKEY" : "",
"JPUSH_OPPO_APPID" : "",
"JPUSH_OPPO_APPSECRET" : "",
"JPUSH_VIVO_APPKEY" : "",
"JPUSH_VIVO_APPID" : "",
"JPUSH_MEIZU_APPKEY" : "",
"JPUSH_MEIZU_APPID" : "",
"JPUSH_XIAOMI_APPKEY" : "",
"JPUSH_XIAOMI_APPID" : "",
"__plugin_info__" : {
"name" : "JG-JPush",
"description" : "极光推送Hbuilder插件",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {
"JPUSH_ISPRODUCTION_IOS" : {
"des" : "[iOS]是否是生产环境是填true不是填false或者不填",
"key" : "JPush:ISPRODUCTION",
"value" : ""
},
"JPUSH_ADVERTISINGID_IOS" : {
"des" : "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"key" : "JPush:ADVERTISINGID",
"value" : ""
},
"JPUSH_DEFAULTINITJPUSH_IOS" : {
"des" : "[iOS]是否默认初始化是填true不是填false或者不填",
"key" : "JPush:DEFAULTINITJPUSH",
"value" : ""
},
"JPUSH_OPPO_APPKEY" : {
"des" : "厂商OPPO-appkey,示例OP-12345678",
"key" : "OPPO_APPKEY",
"value" : ""
},
"JPUSH_OPPO_APPID" : {
"des" : "厂商OPPO-appId,示例OP-12345678",
"key" : "OPPO_APPID",
"value" : ""
},
"JPUSH_OPPO_APPSECRET" : {
"des" : "厂商OPPO-appSecret,示例OP-12345678",
"key" : "OPPO_APPSECRET",
"value" : ""
},
"JPUSH_VIVO_APPKEY" : {
"des" : "厂商VIVO-appkey,示例12345678",
"key" : "com.vivo.push.api_key",
"value" : ""
},
"JPUSH_VIVO_APPID" : {
"des" : "厂商VIVO-appId,示例12345678",
"key" : "com.vivo.push.app_id",
"value" : ""
},
"JPUSH_MEIZU_APPKEY" : {
"des" : "厂商MEIZU-appKey,示例MZ-12345678",
"key" : "MEIZU_APPKEY",
"value" : ""
},
"JPUSH_MEIZU_APPID" : {
"des" : "厂商MEIZU-appId,示例MZ-12345678",
"key" : "MEIZU_APPID",
"value" : ""
},
"JPUSH_XIAOMI_APPKEY" : {
"des" : "厂商XIAOMI-appKey,示例MI-12345678",
"key" : "XIAOMI_APPKEY",
"value" : ""
},
"JPUSH_XIAOMI_APPID" : {
"des" : "厂商XIAOMI-appId,示例MI-12345678",
"key" : "XIAOMI_APPID",
"value" : ""
}
}
}
}
}
},
/* */

View File

@ -47,7 +47,38 @@
"enablePullDownRefresh": true,
// #endif
"app-plus": {
"scrollIndicator": false //
"scrollIndicator": false, //
"subNVues": [{
"id": "concat", //
"path": "pages/index/subnvue/concat", //
"type": "popup",
"style": {
"position": "absolute",
"dock": "right",
"width": "750rpx",
"height": "1500rpx",
"background": "rgba(0,0,0,0.2)"
}
}]
}
}
},
{
"path": "pages/test/index", //
"style": {
"app-plus": {
"subNVues": [{
"id": "concat", //
"path": "pages/test/subnvue/concat", //
/*"type": "popup", */
"style": {
"position": "absolute",
"dock": "right",
"width": "100rpx",
"height": "150rpx",
"background": "transparent"
}
}]
}
}
},
@ -309,8 +340,7 @@
},
{
"path": "pages/cashier/cashier",
"style" :
{
"style": {
"navigationBarTitleText": "收银",
"enablePullDownRefresh": true
}
@ -1367,7 +1397,15 @@
"navigationBarTitleText": "商品详情"
}
}, {
},
{
"path": "goods_details/videoPlay",
"style": {
"navigationBarTitleText": "视屏详情"
}
},
{
"path": "stockOut/index",
"style": {
"navigationBarTitleText": "扫码出库",
@ -1390,7 +1428,22 @@
"path": "list/index",
"style": {
"navigationBarTitleText": "商品管理",
"enablePullDownRefresh": true
"enablePullDownRefresh": true,
"app-plus": {
"scrollIndicator": false, //
"subNVues": [{
"id": "concatpro", //
"path": "list/subnvue/concat", //
"type": "popup",
"style": {
"position": "absolute",
"dock": "right",
"width": "750rpx",
"height": "2000rpx",
"background": "rgba(0,0,0,0.2)"
}
}]
}
}
},
{
@ -1505,7 +1558,14 @@
}, {
"path": "addGood/addGood",
"style": {
"navigationBarTitleText": "商品设置",
"navigationBarTitleText": "发布商品",
"enablePullDownRefresh": false
}
},
{
"path": "addGood/addGoodOld",
"style": {
"navigationBarTitleText": "发布商品",
"enablePullDownRefresh": false
}
},
@ -1536,7 +1596,43 @@
"navigationBarTitleText": "更新库存",
"enablePullDownRefresh": false
}
},
{
"path": "addGoodDetail/addGoodDetail",
"style": {
"navigationBarTitleText": "发布商品",
"enablePullDownRefresh": false
}
},
{
"path": "addGoodDetail/goodsType",
"style": {
"navigationBarTitleText": "商品分类",
"enablePullDownRefresh": false
}
},
{
"path": "addGoodDetail/goodsAttr",
"style": {
"navigationBarTitleText": "商品属性",
"enablePullDownRefresh": false
}
},
{
"path": "addGoodDetail/goodsPrice",
"style": {
"navigationBarTitleText": "价格与规格",
"enablePullDownRefresh": false
}
},
{
"path": "addGoodDetail/goodsSearch",
"style": {
"navigationBarTitleText": "商品分类",
"enablePullDownRefresh": false
}
}
]
},
{

View File

@ -4,24 +4,14 @@
<view class="top">
<view>
<view v-if="user_id == 0" class="accont">
<u--image
:showLoading="true"
:src="userInfo.avatar || '../../static/img/public/man.png'"
width="44px"
height="44px"
shape="circle"
></u--image>
<u--image :showLoading="true" :src="userInfo.avatar || '../../static/img/public/man.png'"
width="44px" height="44px" shape="circle"></u--image>
<view class="name">{{ userInfo.nickname }}</view>
<!-- <u-icon name="setting-fill" color="white" size="20"></u-icon> -->
</view>
<view v-else class="accont">
<u--image
:showLoading="true"
:src="userInfo.avatar || '../../static/img/public/man.png'"
width="44px"
height="44px"
shape="circle"
></u--image>
<u--image :showLoading="true" :src="userInfo.avatar || '../../static/img/public/man.png'"
width="44px" height="44px" shape="circle"></u--image>
<view class="name">{{ userInfo.nickname }}</view>
<!-- <u-icon name="setting-fill" color="white" size="20"></u-icon> -->
@ -33,22 +23,14 @@
</view>
<view class="center">
<view class="title">
<text style="margin-right: 20rpx">账户总金额()</text
><uni-icons
@click="updateEye()"
:type="eyeType ? 'eye-filled' : 'eye-slash-filled'"
color="#fff"
></uni-icons>
<text style="margin-right: 20rpx">账户总金额()</text><uni-icons @click="updateEye()"
:type="eyeType ? 'eye-filled' : 'eye-slash-filled'" color="#fff"></uni-icons>
</view>
<view class="price" v-show="eyeType"
>{{ all_money }}</view
>
<view class="price" v-show="eyeType">{{ all_money }}</view>
<view class="price" v-show="!eyeType">****</view>
<view class="bubble">
<!-- <image src="../../static/img/contract/bubble.png"></image> -->
<view class="text" v-show="eyeType"
>可提现金额{{ userInfo.user_money || 0.0 }}</view
>
<view class="text" v-show="eyeType">可提现金额{{ userInfo.user_money || 0.0 }}</view>
<view class="text" v-show="!eyeType">可提现金额****</view>
</view>
</view>
@ -72,11 +54,7 @@
</view>
<view class="bill">
<view style="width: 100%; height: 90rpx; background-color: #fff"></view>
<uni-section
titleFontSize="32rpx"
type="line"
title="账单流水"
></uni-section>
<uni-section titleFontSize="32rpx" type="line" title="账单流水"></uni-section>
<!-- <u-subsection :list="billTypeList" :current="current" mode="subsection"></u-subsection> -->
<!-- <view class="type_box">
<view class="type">
@ -129,11 +107,8 @@
<text v-if="item.change_type == 202" style="color: #46be61">{{
item.type_desc
}}</text>
<text
v-else-if="item.change_type == 203"
style="color: #ff7c32"
>{{ item.type_desc }}</text
>
<text v-else-if="item.change_type == 203"
style="color: #ff7c32">{{ item.type_desc }}</text>
<text v-else="item.change_type == 203">{{
item.type_desc
}}</text>
@ -172,12 +147,8 @@
</view>
-->
<u-loadmore
:status="loadConfig.status"
:loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText"
:nomore-text="loadConfig.nomoreText"
/>
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
</view>
<!-- 月账单 -->
<view class="bill_list" v-show="current == 1">
@ -192,11 +163,9 @@
<view class="num">{{ item.income }}</view>
</view>
<view class="right">
<view
>支出金额:{{
<view>支出金额:{{
item.expenditure > 0 ? item.expenditure : "0.00"
}}</view
>
}}</view>
<view>入账金额:{{ item.income > 0 ? item.income : "0.00" }}</view>
</view>
</view>
@ -441,8 +410,7 @@ page {
background-repeat: no-repeat;
background-size: 100% 100%;
.text {
}
.text {}
}
}
@ -599,7 +567,6 @@ page {
.top {
margin-bottom: 28rpx;
font-size: 25rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;

View File

@ -1,11 +1,13 @@
<template>
<view class="product-con">
<view v-if="storeInfo && storeInfo.merchant">
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true" :style='"height:"+height+"px;"'
@scroll="scroll">
<scroll-view :scroll-top="scrollTop" scroll-y='true' scroll-with-animation="true"
:style='"height:"+height+"px;"' @scroll="scroll">
<view id="past0">
<productConSwiper :imgUrls="storeInfo.slider_image" :videoCoverImg="videoCoverImg"
:videoline="storeInfo.video_link"></productConSwiper>
<productConSwiper :imgUrls="storeInfo.slider_image"
videoCoverImg="https://tse3-mm.cn.bing.net/th/id/OIP-C.8fSZO4qDjGmIuSfxRNAFpgHaE8?w=270&h=180&c=7&r=0&o=5&dpr=1.3&pid=1.7"
videoline="https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/51838202404242300059216.mp4">
</productConSwiper>
<!--秒杀-->
<view v-if="storeInfo.product_type == 1" class='nav acea-row row-between-wrapper'>
<view class='money'><text class='num'>{{storeInfo.price}}</text><text
@ -13,8 +15,8 @@
<view class='acea-row row-middle'>
<view class='time'>
<view>距秒杀结束仅剩</view>
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '"
:second-text="' '" :datatime="datatime"></countDown>
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '"
:minute-text="' : '" :second-text="' '" :datatime="datatime"></countDown>
</view>
</view>
</view>
@ -35,7 +37,8 @@
<view class='introduce line2'>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red">自营</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)"
class="font-bg-red">自营</text>
{{storeInfo.store_name}}
</view>
<view class="presell_count">
@ -51,7 +54,8 @@
</view>
<view v-if="storeInfo.presell_type === 2">
<view>支付尾款时间</view>
<view v-if="storeInfo.final_start_time && storeInfo.final_end_time" class="presell_time">
<view v-if="storeInfo.final_start_time && storeInfo.final_end_time"
class="presell_time">
<view class='iconfont icon-shijian1'></view>
{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getMonth()+1 }}{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getDate() }}{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getHours() }}{{ new Date(storeInfo.final_start_time.replace(/-/g,"/")).getMinutes()}}
<span class='area_line'>~</span>
@ -81,13 +85,15 @@
<view class='introduce line2'>
<text v-if="(storeInfo.merchant && storeInfo.merchant.type_name)"
class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)" class="font-bg-red">自营</text>
<text v-else-if="(storeInfo.merchant && storeInfo.merchant.is_trader)"
class="font-bg-red">自营</text>
{{storeInfo.store_name}}
</view>
<view class='label acea-row row-between-wrapper'>
<view>类型:{{storeInfo.buying_count_num ? storeInfo.buying_count_num : 0}}人团</view>
<view>库存:{{storeInfo.stock ? storeInfo.stock : 0}}</view>
<view>已拼:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
<view>
已拼:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
</view>
</view>
@ -100,8 +106,8 @@
class='line'>|</text>
</view>
<view class='swiper'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500"
vertical="true" circular="true">
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500"
duration="500" vertical="true" circular="true">
<block v-for="(item,index) in itemNew" :key='index'>
<swiper-item>
<view class='line1'>{{item.nickname ? item.nickname : ''}}拼团成功</view>
@ -115,22 +121,28 @@
v-if="index < AllIndex && pink.length>0">
<view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'>
<image :src='item.initiator.avatar ? item.initiator.avatar : "/static/images/f.png"'></image>
<image
:src='item.initiator.avatar ? item.initiator.avatar : "/static/images/f.png"'>
</image>
</view>
<view class='text line1'>{{ item.initiator.nickname ? item.initiator.nickname : ""}}
</view>
<view class='text line1'>{{ item.initiator.nickname ? item.initiator.nickname : ""}}</view>
</view>
<view class='right acea-row row-middle'>
<view>
<view class='lack'>还差<text
class='font-color'>{{item.buying_count_num - item.yet_buying_num}}</text>人成团</view>
class='font-color'>{{item.buying_count_num - item.yet_buying_num}}</text>人成团
</view>
<view class='time'>
剩余
<count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '" :day-text="' '"
:hour-text="':'" :minute-text="':'" :second-text="' '" :datatime="item.end_time"></count-down>
<count-down :justifyLeft="justifyLeft" :is-day="false" :tip-text="' '"
:day-text="' '" :hour-text="':'" :minute-text="':'" :second-text="' '"
:datatime="item.end_time"></count-down>
</view>
</view>
<navigator hover-class='none'
:url="'/pages/activity/combination_status/index?id='+item.group_buying_id" class='spellBnt'>
:url="'/pages/activity/combination_status/index?id='+item.group_buying_id"
class='spellBnt'>
去拼单
<text class='iconfont icon-jiantou'></text>
</navigator>
@ -169,48 +181,96 @@
</view>
</view>
</view>
<view v-if="storeInfo.product_type == 0 || storeInfo.product_type == 3 || storeInfo.product_type == 1"
class='wrapper'>
<view v-if="storeInfo.product_type != 1" class='share acea-row row-between row-bottom'
style="padding: 0;margin: 0;">
<view class="card" style="">
<view class="">
<view class='money font-color'>
<text class='num'>{{storeInfo.price}}</text>
<text style="font-size:56rpx ;">{{storeInfo.price}}</text><text
style="font-size: 40rpx;color:#777777 ;">/{{storeInfo.unit_name}}</text>
</view>
<view class='iconfont icon-fenxiang' v-if="comForm != 'admin'"></view>
<view class="" style="font-size:32rpx ;color:#444444 ;margin: 20rpx 0;">
{{storeInfo.store_name ? storeInfo.store_name : ''}}
</view>
<view class='introduce line2'>
<text v-if="storeInfo.merchant.type_name" class="font-bg-red">{{storeInfo.merchant.type_name}}</text>
<text v-else-if="storeInfo.merchant.is_trader"
class="font-bg-red bg">自营</text>{{storeInfo.store_name ? storeInfo.store_name : ''}}
</view>
<view class='label acea-row row-between-wrapper' style="padding-bottom: 10px">
<view v-if="storeInfo.product_type != 3">原价:{{storeInfo.ot_price ? storeInfo.ot_price : ''}}</view>
<view>库存:{{storeInfo.stock ? storeInfo.stock : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
<view class="attribute" v-if='product_attribute.leval'>
<view class="attribute-li">
<view class="" style="display: flex;flex-direction: column;align-items: center;">
<view class="" style="margin-bottom: 10rpx;">
等级
</view>
<view>销量:{{storeInfo.sales ? storeInfo.sales : 0}}{{storeInfo.unit_name ? storeInfo.unit_name : ''}}
<view class="">
{{product_attribute.leval}}
</view>
</view>
<u-line direction="col" style="margin: 0 20rpx;" length="60rpx"
color="#A1A1A1"></u-line>
</view>
<view class="attribute-li">
<view class="" style="display: flex;flex-direction: column;align-items: center;">
<view class="" style="margin-bottom: 10rpx;">
产地
</view>
<view class="">
{{product_attribute.address.substring(0,3)}}
</view>
</view>
<u-line direction="col" style="margin: 0 20rpx;" length="60rpx"
color="#A1A1A1"></u-line>
</view>
<view class="attribute-li">
<view class="" style="display: flex;flex-direction: column;align-items: center;">
<view class="" style="margin-bottom: 10rpx;">
包装
</view>
<view class="">
{{product_attribute.pack}}
</view>
</view>
<u-line direction="col" style="margin: 0 20rpx;" length="60rpx"
color="#A1A1A1"></u-line>
</view>
<view class="attribute-li" v-for="item in product_attribute.attr">
<view class="" style="display: flex;flex-direction: column;align-items: center;">
<view class="" style="margin-bottom: 10rpx;">
{{item.label}}
</view>
<view class="">
{{item.value}}
</view>
</view>
<u-line direction="col" style="margin: 0 20rpx;" length="60rpx"
color="#A1A1A1"></u-line>
</view>
<view class="attribute-fixed-right" v-if="storeInfo.product_attribute.attr.length>5">
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
<view class='attribute acea-row row-between-wrapper' @click="selecAttr">
<view class="acea-row row-between-wrapper">{{attrTxt}}
<view class='card'>
<view style="display: flex;justify-content: space-between;" @click="selecAttr">
<view class="">{{attrTxt}}
<text class='atterTxt'>{{attrValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
<view class="">
1{{storeInfo.unit_name}}
<text class='iconfont icon-jiantou'></text>
</view>
<!--运费-->
<view class='attribute acea-row row-between-wrapper' @click="showShip">
<view class="acea-row row-between-wrapper">运费
</view>
<u-line color="#F3F3F3" style="margin: 30rpx 0;" />
<view style="display: flex;justify-content: space-between;" @click="showShip">
<view class="">运费
<text class='atterTxt'>{{shippingValue}}</text>
</view>
<view class='iconfont icon-jiantou'></view>
</view>
</view>
<!--保障-->
<view v-if="guarantee && guarantee.length" class='attribute acea-row row-between-wrapper'
@click="showGuaranee">
<view class="acea-row row-between-wrapper">保障
<view class="guaranteeAttr">
<text class='atterTxt1' :class="item.guarantee_name ? 'hasAttr' : ''" v-for="(item,index) in guarantee">
<text class='atterTxt1' :class="item.guarantee_name ? 'hasAttr' : ''"
v-for="(item,index) in guarantee">
{{item.guarantee_name ? item.guarantee_name : ''}}
</text>
</view>
@ -219,7 +279,8 @@
<view class='iconfont icon-jiantou'></view>
</view>
<!--定金预售流程-->
<view v-if="storeInfo.presell_type === 2" class='acea-row row-between-wrapper wrapper presell_process'>
<view v-if="storeInfo.presell_type === 2"
class='acea-row row-between-wrapper wrapper presell_process'>
<view>流程
<view class='process_count'>
<view class="process_line"></view>
@ -231,7 +292,7 @@
</view>
</view>
<!-- 商铺信息 -->
<view class="store-wrapper" v-if="storeInfo.merchant && hide_mer_status !=1">
<view class="store-wrapper card" v-if="storeInfo.merchant && hide_mer_status !=1">
<view class="store-hd">
<view class="store-info">
<view class="logo">
@ -274,11 +335,21 @@
v-html="description.content.replace(/<br\/>/ig, '')"></view>
<!-- #endif -->
<view v-else class="product_content">
<view v-if="description.content && description.content.title" class="product_content_title">{{description.content.title}}
<view v-if="description.content && description.content.title" class="product_content_title">
{{description.content.title}}
</view>
<block v-if="description.content && description.content.image">
<image v-for="(item,index) in description.content.image" :key="index" :src="item" mode="widthFix" style="background-color: #fff;width: 100vw;">
<view class="" v-for="(item,index) in description.content.image" :key="index">
<view style="position: relative;" v-if='videoTypeList.includes(getSuffix(item))'>
<image :src="item+coverUrl" mode="widthFix"
style="background-color: #fff;width: 100vw;" />
<image class="image-play-icon" src="/static/images/stop.png"
style="width: 100rpx;height: 100rpx;" @click="navGoPlay(item)">
</image>
</view>
<image v-else :src="item" mode="widthFix" style="background-color: #fff;width: 100vw;">
</image>
</view>
</block>
</view>
</view>
@ -287,7 +358,8 @@
</view>
<!-- 组件 -->
<productWindow :attr="attr" :isShow='1' :iSplus='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr"
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'></productWindow>
@ChangeCartNum="ChangeCartNum" @attrVal="attrVal" @iptCartNum="iptCartNum" id='product-window'>
</productWindow>
<guaranteeTemplate ref="guartemplate" :guarantee='guarantee' :shipping='shipping'></guaranteeTemplate>
</view>
</template>
@ -303,16 +375,25 @@
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
import { getProductDetail, getPreviewProDetail } from '@/api/store.js';
import {
getProductDetail,
getPreviewProDetail
} from '@/api/store.js';
import productWindow from '@/components/productWindow';
import productConSwiper from '@/components/productConSwiper';
import { mapGetters } from "vuex";
import productConSwiper from '@/components/productConSwiper/indexNew';
import {
mapGetters
} from "vuex";
import home from '@/components/home';
import countDown from '@/components/countDown';
import parser from "@/components/jyf-parser/jyf-parser";
import { HTTP_REQUEST_URL } from '@/config/app';
import {
HTTP_REQUEST_URL
} from '@/config/app';
import guaranteeTemplate from '@/components/freightGuarantee';
import { configMap } from "@/utils";
import {
configMap
} from "@/utils";
let app = getApp();
export default {
components: {
@ -326,6 +407,11 @@
data() {
let that = this;
return {
coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
show: false,
autoplay: false,
isPlay: false,
videoTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
statusBarHeight: statusBarHeight, //
attrTxt: '请选择', //
attrValue: '', //
@ -401,7 +487,8 @@
itemNew: [],
indicatorDots: false,
preview_key: '',
comForm: '' // admin
comForm: '', // admin
product_attribute: {}
};
},
computed: configMap(['hide_mer_status'], mapGetters(['isLogin', 'uid'])),
@ -432,6 +519,36 @@
// this.getConfig()
},
methods: {
navGoPlay(url) {
console.log(url)
uni.navigateTo({
url: `/pages/admin/goods_details/videoPlay?url=${url}`
})
},
bindPause: function() {
this.show = true
console.log(this.isPlay, 'isplsfds')
this.isPlay = false
this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(() => {
this.videoContext.play();
})
},
endedFun() {
this.controls = true
},
getSuffix(url) {
const str = url;
const lastIndex = str.lastIndexOf(".");
if (lastIndex !== -1) {
const extension = str.substring(lastIndex + 1);
return extension
} else {
console.log("字符串中没有找到点号。");
}
},
boxStatus(data) {
this.showAnimate = data
},
@ -476,7 +593,8 @@
this.$set(this, 'toView', id);
this.$set(this, 'navActive', index);
this.$set(this, 'lock', true);
this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[
this.$set(this, 'scrollTop', index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that
.topArr[
index]);
},
scroll: function(e) {
@ -517,7 +635,8 @@
let productSelect = this.productValue[res];
if (productSelect) this.$set(this, "uniqueValue", productSelect.unique);
if (productSelect && productSelect.stock > 0) {
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this
.storeInfo
.image);
this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "stock", productSelect.stock);
@ -555,7 +674,10 @@
mask: true
});
let that = this;
getProductDetail({ id: that.id, product_type: that.product_type }).then(res => {
getProductDetail({
id: that.id,
product_type: that.product_type
}).then(res => {
uni.hideLoading();
let storeInfo = res.data;
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
@ -593,7 +715,8 @@
that.$set(that, 'PromotionCode', storeInfo.code_base);
that.$set(that, 'activity', res.data.activity ? res.data.activity : []);
that.$set(that, 'shippingValue', res.data.temp ? res.data.temp.name : '');
that.$set(that, 'guaranteeValue', res.data.guarantee ? res.data.guarantee.template_name : '');
that.$set(that, 'guaranteeValue', res.data.guarantee ? res.data.guarantee.template_name :
'');
that.$set(that, 'guarantee', res.data.guaranteeTemplate ? res.data.guaranteeTemplate : []);
that.$set(that, 'shipping', res.data.temp ? res.data.temp.info : '');
uni.setNavigationBarTitle({
@ -621,10 +744,16 @@
mask: true
});
let that = this;
let params = that.preview_key ? { key: that.preview_key } : { id: that.id, product_type: that.product_type }
let params = that.preview_key ? {
key: that.preview_key
} : {
id: that.id,
product_type: that.product_type
}
getPreviewProDetail(params).then(res => {
uni.hideLoading();
let storeInfo = res.data;
this.product_attribute = res.data.product_attribute
if (storeInfo.video_link && storeInfo.slider_image.length > 1) {
this.videoCoverImg = storeInfo.slider_image[0]
storeInfo.slider_image.splice(0, 1)
@ -633,6 +762,10 @@
}
that.$set(that, 'storeInfo', storeInfo);
that.$set(that, 'description', storeInfo.content);
that.description?.content.image.forEach(item => {
item = item.replace(/\\/g, "")
})
if (typeof that.description.content == 'string') {
try {
that.description.content = JSON.parse(that.description.content);
@ -727,7 +860,8 @@
"store_name",
this.storeInfo.store_name
);
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this.storeInfo
this.$set(this.attr.productSelect, "image", productSelect.image ? productSelect.image : this
.storeInfo
.image);
this.$set(this.attr.productSelect, "price", productSelect.price);
this.$set(this.attr.productSelect, "stock", productSelect.stock);
@ -1634,8 +1768,10 @@
}
}
}
.product_content {
background-color: #fff;
&_title {
width: 100%;
height: auto;
@ -1644,9 +1780,58 @@
word-wrap: break-word;
text-align: center;
}
image {
width: 750rpx;
// height: 750rpx;
}
}
.image-play-icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.card {
width: 710rpx;
margin: 20rpx auto;
background-color: white;
border-radius: 16rpx;
padding: 20rpx;
}
.attribute {
display: flex;
background-color: #F6F6F6;
// padding: 10rpx;
width: 670rpx;
height: 112rpx;
overflow-x: auto;
white-space: nowrap;
border-radius: 8rpx;
position: relative;
}
.attribute-li {
display: flex;
padding: 10rpx 0;
font-size: 24rpx;
align-items: center;
}
.attribute-fixed-right {
top: 0rpx;
position: sticky;
right: -30rpx;
height: 112rpx;
padding: 0;
width: 100rpx;
background: #F6F6F6;
box-shadow: -6rpx 0rpx 6rpx 2rpx rgba(220, 220, 220, 0.28);
border-radius: 0rpx 8rpx 8rpx 0rpx;
display: flex;
align-items: center;
}
</style>

View File

@ -0,0 +1,45 @@
<template>
<view class="">
<video :src="url" style="width: 750rpx;height: 1400rpx;" :autoplay='true' id="myvideo" controls></video>
</view>
</template>
<script>
export default {
data() {
return {
url: ""
}
},
methods: {
videoPlay() {
console.log("开始播放了")
},
videoShow() {
this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传
this.videoUrl = this.url;
this.videoContext.requestFullScreen({
// direction: 90
});
this.videoContext.play();
this.videoPlay = true; // 显示播放盒子
}
},
onLoad(option) {
this.url = option.url
setTimeout(() => {
this.videoShow()
})
}
}
</script>
<style>
</style>

View File

@ -16,7 +16,8 @@
</view>
<view>{{ orderInfo.mer_delivery_address }}</view>
<!-- #ifdef H5 -->
<button class="copy copy-data" :data-clipboard-text="'收货人姓名'+orderInfo.mer_delivery_user+'\n收货人电话'+ orderInfo.phone+'\n收货人地址'+orderInfo.mer_delivery_address">复制</button>
<button class="copy copy-data"
:data-clipboard-text="'收货人姓名:'+orderInfo.mer_delivery_user+'\n收货人电话'+ orderInfo.phone+'\n收货人地址'+orderInfo.mer_delivery_address">复制</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class="copy" @tap="copyText">复制</button>
@ -26,7 +27,9 @@
<image :src="`${domain}/static/images/line.jpg`" />
</view>
<view class="pos-order-goods">
<navigator :url="`/pages/goods_details/index?id=${item.product.cart_info.product.product_id}`" hover-class="none" class="goods acea-row row-between-wrapper" v-for="(item, index) in orderInfo.refundProduct" :key="index">
<navigator :url="`/pages/goods_details/index?id=${item.product.cart_info.product.product_id}`"
hover-class="none" class="goods acea-row row-between-wrapper"
v-for="(item, index) in orderInfo.refundProduct" :key="index">
<view class="picTxt acea-row row-between-wrapper">
<view class="pictrue">
<image :src="item.product.cart_info.product.image || item.product.cart_info.product.image" />
@ -71,7 +74,7 @@
</view>
<view class="item acea-row row-between">
<view>退款原因</view>
<view class="conter">{{ orderInfo.refund_message }}</view>
<view class="conter">{{ getRightText(orderInfo.refund_message) }}</view>
</view>
<view class="item acea-row row-between">
<view>备注信息</view>
@ -90,7 +93,9 @@
<view class="footer acea-row row-right row-middle" v-if="goname != 'looks'">
<view class="more"></view>
<view class="bnt cancel" @click="modify('1')">订单备注</view>
<navigator class="bnt cancel" v-if="orderInfo.status == 2" :url="'/pages/users/goods_logistics/index?refundId='+orderInfo.refund_order_id+'&merId='+mer_id">查看物流</navigator>
<navigator class="bnt cancel" v-if="orderInfo.status == 2"
:url="'/pages/users/goods_logistics/index?refundId='+orderInfo.refund_order_id+'&merId='+mer_id">查看物流
</navigator>
<view class="bnt delivery" v-if="orderInfo.status == 2" @click="confirmOrder">确认收货</view>
</view>
<view>
@ -100,10 +105,7 @@
<span class="iconfont icon-guanbi" @click="changeclose"></span>
</view>
<view class="listChange">
<textarea
placeholder="请填写备注信息..."
v-model="orderInfo.mer_mark"
></textarea>
<textarea placeholder="请填写备注信息..." v-model="orderInfo.mer_mark"></textarea>
</view>
<view class="modify" @click="save">
确认提交
@ -132,12 +134,15 @@
refundOrderReceive,
setRefundMark
} from "@/api/admin";
import { isMoney } from '@/utils/validate.js'
import { HTTP_REQUEST_URL } from '@/config/app';
import {
isMoney
} from '@/utils/validate.js'
import {
HTTP_REQUEST_URL
} from '@/config/app';
export default {
name: "AdminOrder",
components: {
},
components: {},
props: {},
data: function() {
return {
@ -192,6 +197,14 @@
},
methods: {
getRightText(str) {
const index = str.indexOf("@");
if (index !== -1) {
return str.substring(index + 1);
} else {
return str
}
},
more: function() {
this.order = !this.order;
},
@ -218,8 +231,7 @@
},
copyText: function(e) {
// var copy = e.currentTarget.dataset.copy; //data-copy
let arr = [
{
let arr = [{
name: "收货人姓名",
value: this.orderInfo.real_name
},
@ -293,7 +305,9 @@
title: '请输入备注'
})
}
setRefundMark(that.mer_id,that.orderInfo.refund_order_id,{ mer_mark: that.orderInfo.mer_mark }).then(
setRefundMark(that.mer_id, that.orderInfo.refund_order_id, {
mer_mark: that.orderInfo.mer_mark
}).then(
res => {
that.change = false;
this.$util.Tips({
@ -348,36 +362,44 @@
background: -webkit-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
background: -moz-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
}
.pos-order-details .header .state {
font-size: 36upx;
color: #fff;
}
.pos-order-details .header .data {
margin-left: 35upx;
font-size: 28upx;
}
.pos-order-details .header .data .order-num {
font-size: 30upx;
margin-bottom: 8upx;
}
.pos-order-details .remarks {
width: 100%;
height: 86upx;
background-color: #fff;
padding: 0 30upx;
}
.pos-order-details .remarks .iconfont {
font-size: 40upx;
color: #2a7efb;
}
.pos-order-details .remarks input {
width: 630upx;
height: 100%;
font-size: 30upx;
}
.pos-order-details .remarks input::placeholder {
color: #666;
}
.pos-order-details .orderingUser {
font-size: 26upx;
color: #282828;
@ -387,17 +409,21 @@
margin-top: 16upx;
border-bottom: 1px solid #f5f5f5;
}
.pos-order-details .orderingUser .iconfont {
font-size: 40upx;
color: #2a7efb;
margin-right: 15upx;
}
.pos-order-details .address {
margin-top: 0;
}
.pos-order-details .pos-order-goods {
margin-top: 17upx;
}
.pos-order-details .footer .more {
font-size: 27upx;
color: #aaa;
@ -408,11 +434,13 @@
margin-right: 25upx;
position: relative;
}
.pos-order-details .footer .delivery {
background: linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
background: -webkit-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
background: -moz-linear-gradient(to right, #2291f8 0%, #1cd1dc 100%);
}
.pos-order-details .footer .more .order .arrow {
width: 0;
height: 0;
@ -423,6 +451,7 @@
left: 15upx;
bottom: -18upx;
}
.pos-order-details .footer .more .order .arrow:before {
content: '';
width: 0;
@ -434,6 +463,7 @@
left: -10upx;
bottom: 0;
}
.pos-order-details .footer .more .order {
width: 200upx;
background-color: #fff;
@ -443,68 +473,84 @@
top: -200upx;
z-index: 9;
}
.pos-order-details .footer .more .order .item {
height: 77upx;
line-height: 77upx;
}
.pos-order-details .footer .more .order .item~.item {
border-top: 1px solid #f5f5f5;
}
.pos-order-details .footer .more .moreName {
width: 100%;
height: 100%;
}
.order-details .header {
padding: 0 30upx;
height: 150upx;
}
.order-details .header.on {
background-color: #666 !important;
}
.order-details .header .pictrue {
width: 110upx;
height: 110upx;
}
.order-details .header .pictrue image {
width: 100%;
height: 100%;
}
.order-details .header .data {
color: rgba(255, 255, 255, 0.8);
font-size: 24upx;
margin-left: 27upx;
}
.order-details .header.on .data {
margin-left: 0;
}
.order-details .header .data .state {
font-size: 30upx;
font-weight: bold;
color: #fff;
margin-bottom: 7upx;
}
.order-details .nav {
background-color: #fff;
font-size: 26upx;
color: #282828;
padding: 25upx 0;
}
.order-details .nav .navCon {
padding: 0 40upx;
}
.order-details .nav .navCon .on {
font-weight: bold;
color: #e93323;
}
.order-details .nav .progress {
padding: 0 65upx;
margin-top: 10upx;
}
.order-details .nav .progress .line {
width: 100upx;
height: 2upx;
background-color: #939390;
}
.order-details .nav .progress .iconfont {
font-size: 25upx;
color: #939390;
@ -515,6 +561,7 @@
text-align: center;
margin-right: 0 !important;
}
.order-details .address {
font-size: 26upx;
color: #868686;
@ -522,52 +569,64 @@
padding: 25upx 30upx 30upx 30upx;
position: relative;
}
.order-details .address .name {
font-size: 30upx;
color: #282828;
margin-bottom: 0.1rem;
}
.order-details .address .name .phone {
margin-left: 40upx;
}
.order-details .line {
width: 100%;
height: 3upx;
}
.order-details .line image {
width: 100%;
height: 100%;
display: block;
}
.order-details .wrapper {
background-color: #fff;
margin-top: 12upx;
padding: 30upx;
}
.order-details .wrapper .item {
font-size: 28upx;
color: #282828;
}
.order-details .wrapper .item~.item {
margin-top: 20upx;
}
.order-details .wrapper .item .conter {
color: #868686;
text-align: right;
}
.order-details .wrapper .item .virtual_image {
// text-align: left;
margin-left: 50rpx;
}
.order-details .wrapper .item .virtual_image .picture {
width: 106rpx;
height: 106rpx;
border-radius: 8rpx;
margin-right: 10rpx;
&:last-child {
margin-right: 0;
}
}
.order-details .wrapper .item .conter .copy {
font-size: 20rpx;
color: #868686;
@ -581,6 +640,7 @@
justify-content: center;
border-radius: 16rpx;
}
.address .copy {
font-size: 20rpx;
color: #868686;
@ -596,15 +656,18 @@
right: 30rpx;
top: 20rpx;
}
.order-details .wrapper .actualPay {
border-top: 1upx solid #eee;
margin-top: 30upx;
padding-top: 30upx;
}
.order-details .wrapper .actualPay .money {
font-weight: bold;
font-size: 30upx;
}
.order-details .footer {
width: 100%;
height: 100upx;
@ -615,6 +678,7 @@
padding: 0 30upx;
border-top: 1px solid #eee;
}
.order-details .footer .bnt {
width: auto;
height: 60upx;
@ -626,52 +690,65 @@
font-size: 27upx;
padding: 0 3%;
}
.order-details .footer .bnt.cancel {
color: #aaa;
border: 1px solid #ddd;
}
.order-details .footer .bnt.default {
color: #444;
border: 1px solid #444;
}
.order-details .footer .bnt~.bnt {
margin-left: 18upx;
}
.pos-order-goods {
padding: 0 30upx;
background-color: #fff;
}
.pos-order-goods .goods {
height: 185upx;
position: relative;
}
.pos-order-goods .goods~.goods {
border-top: 1px dashed #e5e5e5;
}
.pos-order-goods .goods .picTxt {
width: 515upx;
}
.pos-order-goods .goods .picTxt .pictrue {
width: 130upx;
height: 130upx;
}
.pos-order-goods .goods .picTxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 6upx;
}
.pos-order-goods .goods .picTxt .text {
width: 365upx;
height: 130upx;
}
.pos-order-goods .goods .picTxt .text .info {
font-size: 28upx;
color: #282828;
}
.pos-order-goods .goods .picTxt .text .attr {
font-size: 24upx;
color: #999;
}
.pos-order-goods .goods .money {
width: 164upx;
text-align: right;
@ -681,21 +758,86 @@
right: 0;
color: #999999;
}
.pos-order-goods .goods .money .refund_num {
display: inline-block;
margin-left: 10rpx;
}
.pos-order-goods .goods .x-money {
color: #FF9600;
}
.priceChange{position:fixed;width:580upx;background-color:#fff;border-radius:10upx;top:50%;left:50%;margin-left:-290upx;margin-top:-335upx;z-index:666;transition:all 0.3s ease-in-out 0s;transform: scale(0);opacity:0;}
.priceChange.on{opacity:1;transform: scale(1);}
.priceChange .priceTitle{background:url("~@/static/images/pricetitle.jpg") no-repeat;background-size:100% 100%;width:100%;height:160upx;border-radius:10upx 10upx 0 0;text-align:center;font-size:40upx;color:#fff;line-height:160upx;position:relative;}
.priceChange .priceTitle .iconfont{position:absolute;font-size:40upx;right:26upx;top:23upx;width:40upx;height:40upx;line-height:40upx;}
.priceChange .listChange{padding:0 40upx;}
.priceChange .listChange textarea{box-sizing: border-box;}
.priceChange .listChange .item{height:103upx;border-bottom:1px solid #e3e3e3;font-size:32upx;color:#333;}
.priceChange .modify{font-size:32upx;color:#fff;width:490upx;height:90upx;text-align:center;line-height:90upx;border-radius:45upx;background-color:#2291f8;margin:53upx auto;}
.priceChange {
position: fixed;
width: 580upx;
background-color: #fff;
border-radius: 10upx;
top: 50%;
left: 50%;
margin-left: -290upx;
margin-top: -335upx;
z-index: 666;
transition: all 0.3s ease-in-out 0s;
transform: scale(0);
opacity: 0;
}
.priceChange.on {
opacity: 1;
transform: scale(1);
}
.priceChange .priceTitle {
background: url("~@/static/images/pricetitle.jpg") no-repeat;
background-size: 100% 100%;
width: 100%;
height: 160upx;
border-radius: 10upx 10upx 0 0;
text-align: center;
font-size: 40upx;
color: #fff;
line-height: 160upx;
position: relative;
}
.priceChange .priceTitle .iconfont {
position: absolute;
font-size: 40upx;
right: 26upx;
top: 23upx;
width: 40upx;
height: 40upx;
line-height: 40upx;
}
.priceChange .listChange {
padding: 0 40upx;
}
.priceChange .listChange textarea {
box-sizing: border-box;
}
.priceChange .listChange .item {
height: 103upx;
border-bottom: 1px solid #e3e3e3;
font-size: 32upx;
color: #333;
}
.priceChange .modify {
font-size: 32upx;
color: #fff;
width: 490upx;
height: 90upx;
text-align: center;
line-height: 90upx;
border-radius: 45upx;
background-color: #2291f8;
margin: 53upx auto;
}
.priceChange .listChange textarea {
border: 1px solid #eee;
width: 100%;
@ -705,19 +847,23 @@
color: #333;
padding: 20upx;
}
.upload-img {
display: flex;
flex-wrap: wrap;
margin-top: 20rpx;
.img-item {
position: relative;
width: 156rpx;
height: 156rpx;
margin-right: 23rpx;
margin-top: 20rpx;
&:nth-child(4n) {
margin-right: 0;
}
image {
width: 156rpx;
height: 156rpx;

View File

@ -106,6 +106,7 @@
this.isAuto = true;
this.isShowAuth = true
}
this.getindex()
},
onHide() {
if (this.timer) {
@ -145,6 +146,8 @@
this.isAuto = true;
this.isShowAuth = true
}
// this.getList(this.mer_id)
// this.getList(res.data.service.mer_id, true);
});
},
onLoadFun() {

View File

@ -9,8 +9,8 @@
<view class="item-one">
被委托商家
</view>
<e-select v-model="formData.entrust_mer_id" :value='formData.entrust_mer_id' :options="options1" @change="change1"
placeholder="选择选项"></e-select>
<e-select v-model="formData.entrust_mer_id" :value='formData.entrust_mer_id' :options="options1"
@change="change1" placeholder="选择选项"></e-select>
</view>
<view class="release_item-one">
<view class="item-one">
@ -316,7 +316,6 @@
.center-one-txt {
.one-txta {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -325,7 +324,6 @@
display: flex;
margin-top: 28rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
@ -351,7 +349,6 @@
margin-top: 32rpx;
margin-bottom: 20rpx;
font-size: 32rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
@ -525,7 +522,6 @@
background: linear-gradient(84deg, #F98649 0%, #F34E45 100%);
border-radius: 42px 42px 42px 42px;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}

View File

@ -101,7 +101,8 @@
<view class="center-twoa">
拒绝原因:
</view>
<view class="center-twob" :style="{'text-align':objinfo.entrust_finish_refusal.length<15?'right':'left'}">
<view class="center-twob"
:style="{'text-align':objinfo.entrust_finish_refusal.length<15?'right':'left'}">
{{objinfo.entrust_finish_refusal}}
</view>
</view>
@ -233,7 +234,6 @@
.top-two-one {
font-size: 35rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-top: 10rpx;
@ -280,7 +280,6 @@
.center-one-txt {
.one-txta {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -289,7 +288,6 @@
display: flex;
margin-top: 28rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
@ -316,7 +314,6 @@
.center-twoa {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333;
}
@ -327,7 +324,6 @@
word-wrap: break-word;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
}
@ -377,7 +373,6 @@
background: linear-gradient(84deg, #F98649 0%, #F34E45 100%);
border-radius: 42px 42px 42px 42px;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
position: absolute;

View File

@ -147,7 +147,6 @@
.titlea {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
@ -155,7 +154,6 @@
.titleb {
margin-top: 5rpx;
font-size: 25rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(255, 255, 255, 0.8);
}

View File

@ -542,7 +542,6 @@
.adddelegation-two {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-top: 25rpx;
@ -593,7 +592,6 @@
.txt-b-a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -612,7 +610,6 @@
.txt-b-b {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333
}
@ -625,15 +622,18 @@
display: flex;
flex-direction: column;
justify-content: space-between;
.text-bottom {
display: flex;
justify-content: space-between;
}
.one-txt-a {
flex: 1;
font-size: 30rpx;
display: -webkit-box;
-webkit-line-clamp: 2; /* 限制为三行 */
-webkit-line-clamp: 2;
/* 限制为三行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
@ -686,7 +686,6 @@
.contentgn_a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #F84221;
margin-right: 10rpx;
@ -704,7 +703,6 @@
.contentgn_b {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 10rpx;
@ -760,7 +758,6 @@
.contentgn_a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #F84221;
margin-right: 10rpx;
@ -777,7 +774,6 @@
.contentgn_b {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 10rpx;
@ -819,7 +815,6 @@
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -827,14 +822,12 @@
.bg-content-b {
margin-left: 35rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 32rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
@ -844,14 +837,12 @@
.bg-content-c {
margin-left: 35rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 32rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
@ -867,7 +858,6 @@
height: 95rpx;
line-height: 95rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 121rpx;
@ -880,7 +870,6 @@
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
@ -904,7 +893,6 @@
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -917,7 +905,6 @@
height: 95rpx;
line-height: 95rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 121rpx;
@ -930,7 +917,6 @@
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);
@ -957,7 +943,6 @@
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -965,14 +950,12 @@
.bg-content-b {
margin-left: 35rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 32rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
@ -982,14 +965,12 @@
.bg-content-c {
margin-left: 35rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 22rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
@ -1017,7 +998,6 @@
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);

View File

@ -59,22 +59,26 @@
<view class="content-two_oneq" v-if="item.mer_status==1">
<view class="contentgn">
<block v-if="item.entrust_order_id>0&&item.mer_status==1">
<view class="contentgn_a" v-if="item.entrust_finish==0" style="margin-left: 10rpx;" @click="closingorder(item)">
<view class="contentgn_a" v-if="item.entrust_finish==0"
style="margin-left: 10rpx;" @click="closingorder(item)">
申请结束
</view>
<view class="contentgn_a" v-else-if="item.entrust_finish==1" style="margin-left: 10rpx; color: #20A162;">
<view class="contentgn_a" v-else-if="item.entrust_finish==1"
style="margin-left: 10rpx; color: #20A162;">
已结束
</view>
<view class="contentgn_a" v-else-if="item.entrust_finish==2" @click="closingorder(item)" style="margin-left: 10rpx;">
<view class="contentgn_a" v-else-if="item.entrust_finish==2"
@click="closingorder(item)" style="margin-left: 10rpx;">
被拒绝
</view>
<view class="contentgn_a" v-else-if="item.entrust_finish==3" style="margin-left: 10rpx; color: #FE9A10;">
<view class="contentgn_a" v-else-if="item.entrust_finish==3"
style="margin-left: 10rpx; color: #FE9A10;">
申请中
</view>
<span></span>
</block>
<view class="contentgn_a" v-if="item.entrust_order_id==0" style="margin-left: 10rpx;"
@click="order(item)">
<view class="contentgn_a" v-if="item.entrust_order_id==0"
style="margin-left: 10rpx;" @click="order(item)">
去下单
</view>
<span v-if="item.entrust_order_id==0"></span>
@ -531,7 +535,6 @@
.txt-b-a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -550,7 +553,6 @@
.txt-b-b {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: #333333
}
@ -563,15 +565,18 @@
display: flex;
flex-direction: column;
justify-content: space-between;
.text-bottom {
display: flex;
justify-content: space-between;
}
.one-txt-a {
flex: 1;
font-size: 30rpx;
display: -webkit-box;
-webkit-line-clamp: 2; /* 限制为三行 */
-webkit-line-clamp: 2;
/* 限制为三行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
@ -624,7 +629,6 @@
.contentgn_a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #F84221;
margin-right: 10rpx;
@ -642,7 +646,6 @@
.contentgn_b {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 10rpx;
@ -698,7 +701,6 @@
.contentgn_a {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #F84221;
margin-right: 10rpx;
@ -716,7 +718,6 @@
.contentgn_b {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 10rpx;
@ -757,7 +758,6 @@
.bg-content-a {
margin-left: 242rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
}
@ -765,14 +765,12 @@
.bg-content-b {
margin-left: 35rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 16rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
@ -782,30 +780,27 @@
.bg-content-c {
margin-left: 35rpx;
font-size: 35rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 16rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
}
}
.bg-content-d {
margin-left: 35rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #333333;
margin-top: 16rpx;
span {
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #F84221;
margin-left: 18rpx;
@ -821,7 +816,6 @@
height: 95rpx;
line-height: 95rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: #999999;
margin-left: 121rpx;
@ -834,7 +828,6 @@
line-height: 95rpx;
text-align: center;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
background: linear-gradient(180deg, #F98649 0%, #F34E45 100%);

View File

@ -78,10 +78,11 @@
常用工具
<view class=""></view>
</view>
<view class="tools-two"
<!-- <view class="tools-two"
v-if="isgShow&&userInfoData.mer_info.setting_status==1&&userInfoData.mer_info.type_code=='TypeSupplyChain'">
<view class="" v-for="(item,k) in typelistSupplyChain" :key='k' @click="navation(item)">
<view class="tools-two-img">
<image :src="item.image" mode=""></image>
</view>
<view class="tools-two-title"> {{item.name}}</view>
@ -91,27 +92,28 @@
v-else-if="isgShow&&userInfoData.mer_info.setting_status==1&&userInfoData.mer_info.type_code=='PersonalStore'">
<view class="" v-for="(item,k) in typePersonalStoreList" :key='k' @click="navation(item)">
<view class="tools-two-img">
<image :src="item.image" mode=""></image>
</view>
<view class="tools-two-title"> {{item.name}}</view>
</view>
</view>
<view class="tools-two" v-else-if="isgShow&&userInfoData.mer_info.setting_status==1">
</view> -->
<view class="tools-two" v-if="isgShow">
<view class="" v-for="(item,k) in typelist" :key='k' @click="navation(item)">
<view class="tools-two-img">
<view class="tools-two-img " :id="'asas'+k">
<image :src="item.image" mode=""></image>
</view>
<view class="tools-two-title"> {{item.name}}</view>
</view>
</view>
<view class="tools-two" v-else>
<!-- <view class="tools-two" v-else>
<view class="" @click="byset">
<view class="tools-two-img">
<image src="@/static/images/index11.png" mode=""></image>
</view>
<view class="tools-two-title"> 商家设置</view>
</view>
</view>
</view> -->
</view>
<view class="content-list">
@ -417,8 +419,10 @@
merstreet,
getUserInfo,
getAdminApplyAPI,
progressBankList
progressBankList,
isNewMer
} from '@/api/user.js';
import {
business,
intention,
@ -446,6 +450,8 @@
},
data() {
return {
subNVue: '',
elInfo: {},
isAuto: false, //
isShowAuth: false, //
loadEndFlag: false,
@ -510,11 +516,11 @@
type: 1,
image: require('@/static/images/index7.png')
},
{
name: '入库管理',
type: 13,
image: require('@/static/images/index9.png')
},
// {
// name: '',
// type: 13,
// image: require('@/static/images/index9.png')
// },
// {
// name: '',
// type: 3,
@ -611,11 +617,11 @@
type: 1,
image: require('@/static/images/index7.png')
},
{
name: '入库管理',
type: 13,
image: require('@/static/images/index9.png')
},
// {
// name: '',
// type: 13,
// image: require('@/static/images/index9.png')
// },
{
name: '订单管理',
type: 2,
@ -691,11 +697,11 @@
type: 1,
image: require('@/static/images/index7.png')
},
{
name: '入库管理',
type: 13,
image: require('@/static/images/index9.png')
},
// {
// name: '',
// type: 13,
// image: require('@/static/images/index9.png')
// },
{
name: '订单管理',
type: 2,
@ -838,6 +844,7 @@
},
async onLoad() {
this.subNVue = uni.getSubNVueById('concat')
this.Fheight = uni.getSystemInfoSync().windowHeight + 'px';
await this.$onLaunched;
this.list1();
@ -846,6 +853,13 @@
this.$u.sleep(5000).then(() => {
this.loadEndFlag = true;
});
uni.$on('diverIndexSubEmit', () => {
this.subNVue.hide()
uni.navigateTo({
url: '/pages/product/list/index'
})
})
},
onReachBottom() {
@ -856,11 +870,36 @@
}, 10)
}
},
onReady() {
// if (Boolean(this.$store.state.app.userInfo.service?.mer_id)) {
// isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id).then(res => {
// if (res.data == 'true') {
// let that = this
// const query = uni.createSelectorQuery().in(this);
// query
// .select(".tools-two-img")
// .boundingClientRect((data) => {
// let info = JSON.stringify(data)
// that.elInfo = data
// // #ifdef APP-PLUS
// that.openDiver()
// // #endif
// })
// .exec();
// }
// })
// }
},
onShow() {
if (this.loadEndFlag) {
this.codelist();
this.getUserInfo();
} else {
this.isNewUser()
console.log('1111111111')
}
// this.getGoods(true);
},
@ -871,6 +910,56 @@
},
methods: {
isNewUser(data) {
let user;
if (data) {
user = data
} else {
user = this.$store.state.app.userInfo
}
setTimeout(() => {
if (Boolean(user.service?.mer_id)) {
isNewMer(user.uid, user.service
?.mer_id).then(
res => {
if (res.data == 'true' && this.elInfo) {
let that = this
setTimeout(() => {
const query = uni.createSelectorQuery().in(this);
query
.select(".tools-two-img")
.boundingClientRect((data) => {
let info = JSON.stringify(data)
that.elInfo = data
// #ifdef APP-PLUS
that.openDiver()
// #endif
})
.exec();
}, 500)
}
})
}
}, 500)
},
test1() {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id).then(res => {
console.log(res, 'res')
})
},
test2() {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
done: 1
}).then(res => {
console.log(res, 'res')
})
},
openDiver() {
this.subNVue.show('zoom-out', 300)
uni.$emit('diverIndexEmit', this.elInfo);
},
//
handleToWithDraw(item, index) {
if (index == 4) return;
@ -1295,6 +1384,7 @@
this.userid = res.data.uid
this.userInfoData = res.data;
this.$store.commit('SET_USERINFO', res.data);
this.isNewUser(res.data)
this.merchantData.phone = res.data.phone;
if (res.data.mer_info.is_company == 0) !this.merchantData.company_name ? this.merchantData
.company_name = "" : null;

View File

@ -0,0 +1,247 @@
<template>
<view class="" style="width: 750rpx;height: 100%;">
<view class="jump" @click="jump">
<text class="font">跳过</text>
</view>
<view class="target" :style="{left:(left-9)+'px',top:(top-9)+'px'}">
<image src="/static/images/index7.png" class="imgs"></image>
</view>
<view class="" class="pointe" :style="{ left:(left-10)+'px',top:(top)+'px'}">
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;" mode=""></image>
</view>
<view class="tips" :style="{ left:left+'px',top:(top-200)+'px'}">
<view class="tras" :class="{act:isActive}">
<text class="font" style="line-height: 106rpx;">点击商品管理,发布商品</text>
</view>
</view>
<view class="center" :style="{left:(left+35)+'px', top:(top-60)+'px'}">
<image src="/static/images/greenLine.png" style="width:35px;height: 60px;" mode=""></image>
</view>
<view class="next-btn">
<text class="next-btn-text font" @click="next">下一步(3/4) </text>
</view>
</view>
</template>
<script>
import {
isNewMer
} from '@/api/user.js';
export default {
data() {
return {
isActive: false,
left: 33,
top: 0,
subNVue: null,
offsetX: 0,
offsetY: 0,
}
},
methods: {
jump() {
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
done: 1
}).then(res => {
console.log(res, 'res')
})
this.subNVue.hide('zoom-in', 300, )
},
next() {
// this.subNVue = uni.getSubNVueById('concat')
// this.subNVue.hide('zoom-in', 300, )
uni.$emit('diverIndexSubEmit');
}
},
onLoad() {
this.subNVue = uni.getSubNVueById('concat')
let that = this
uni.$on('diverIndexEmit', (data) => {
that.left = data.left
that.top = data.top
})
setTimeout(() => {
that.isActive = true
}, 1000)
}
}
</script>
<style>
.target {
position: relative;
width: 160rpx;
height: 160rpx;
border-radius: 160rpx;
background-color: white;
}
.greenLine {
width: 10rpx;
height: 100rpx;
background-color: green;
position: absolute;
left: 40px;
transform: translate(-50%, 0);
z-index: 999;
top: -40px;
}
.imgs {
width: 62px;
height: 62px;
position: absolute;
left: 40px;
top: 40px;
transform: translate(-50%, -50%);
}
.tras {
position: absolute;
z-index: 999 !important;
width: 0;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.act {
width: 462rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
}
.bgimg {
width: 200rpx;
position: absolute;
z-index: 1;
}
.img {
opacity: 0;
width: 50rpx;
height: 50rpx;
transition-property: opacity;
transition-duration: 1s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.next-btn {
position: absolute;
bottom: 100rpx;
left: 375rpx;
transform: translateX(-50%);
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
background: rgba(255, 255, 255, 0.4);
}
.next-btn-text {
line-height: 76rpx;
text-align: center;
}
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
border: 1px solid white;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
.tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
}
.center {
position: absolute;
left: 375rpx;
transform: translateX(-50%);
}
.tabbar {
width: 136rpx;
height: 136rpx;
background-color: white;
border-radius: 136rpx;
position: absolute;
}
.tab-icon {
width: 50rpx;
height: 50rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, -50%);
top: 68rpx;
}
.te {
font-size: 20rpx;
position: absolute;
left: 68rpx;
transform: translate(-50%, 0);
top: 100rpx;
}
.pointe {
position: absolute;
}
.tras {
padding-left: 20rpx;
position: absolute;
z-index: 999 !important;
width: 20px;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.act {
width: 462rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
}
.next-btn {
position: absolute;
bottom: 100px;
left: 375rpx;
transform: translateX(-50%);
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
}
.next-btn-text {
line-height: 76rpx;
text-align: center;
}
</style>

View File

@ -1,14 +1,14 @@
<template>
<view class="select_warehouse">
<view class="wrapper flex_a_c_j_sb">
<!-- <view class="wrapper flex_a_c_j_sb">
<block v-for="item in goodsData" :key="item.name">
<view class="select_item select_item1" @click="navigato(item.type)" :class="'select_item'+item.type">
<view class="title">{{ item.name }}</view>
<!-- <view class="iconfont icon-jiantou"></view> -->
{{item.type}}
<image class="img" :src="item.src"></image>
</view>
</block>
</view>
</view> -->
<view v-if="pageType==1" class="list-box-put">
<view class="item" v-for="(item, index) in goods" :key="index">
<view class="top">
@ -171,11 +171,11 @@
</view>
</view>
</u-popup>
<u-popup :show="searchGoodsShow" @close="searchGoodsClose" :round="18" mode="center">
<u-popup :show="searchGoodsShow" :round="18" mode="center">
<view class="search_goods_box">
<input type="text" v-model="searchGoodsName" class="searchGoods" placeholder="请输入商品名称">
<view class="search_goods_btn">
<view class="cancel edit_btn" @click="searchGoodsShow=false">取消</view>
<view class="cancel edit_btn" @click="handCancel">取消</view>
<view class="search edit_btn" @click="searchGoodsClose">搜索</view>
</view>
</view>
@ -194,6 +194,7 @@
import {
productCreate
} from '@/api/product.js'
import {
microSeachBarCode,
microEadtProduct,
@ -217,19 +218,16 @@
goodsData: [{
name: '搜索名称入库',
type: 1,
// src: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/mingcheng.png'
src: '/static/images/SMRK/name.png'
},
{
name: '标品扫码入库',
type: 2,
// src: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/saoma.png'
src: '/static/images/SMRK/bar.png'
},
{
name: '非标手动入库',
type: 3,
// src: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/saoma.png'
src: '/static/images/SMRK/img.png'
}
],
@ -295,6 +293,15 @@
this.mer_id = e.mer_id
this.userInfo = this.$store.state.app.userInfo;
if (typeof this.userInfo == 'string') this.userInfo = JSON.parse(this.userInfo);
if (e.type) {
uni.showLoading({
title: '正在加载中'
});
setTimeout(() => {
uni.hideLoading();
this.navigato(e.type)
}, 700)
}
// if(this.userInfo.mer_info.type_code=='PersonalStore'){
// this.goodsData = [{
// name: '',
@ -305,11 +312,21 @@
// }
},
onShow() {
console.log('show')
},
methods: {
handCancel() {
uni.redirectTo({
url: '/pages/product/list/index'
})
},
addGoods(item = {}) {
item = JSON.parse(JSON.stringify(item));
item = (JSON.stringify(item));
console.log(item)
uni.navigateTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&goodsInfo=${item}`
})
return
// if(this.isNullImage(item.image)||
// ( this.isNullImage(item.slider_image[0]) && this.isNullImage(item.slider_image[1]) && this.isNullImage(item.slider_image[2]) )){
// return Toast('');
@ -624,13 +641,13 @@
}
},
navigato(type) {
if (type === 1) {
if (type == 1) {
this.searchGoodsName = '';
this.searchGoodsShow = true;
this.pageType = 1;
} else if (type == 2) {
this.scanCode();
this.pageType = 1;
// this.pageType = 1;
} else {
// this.photograph();
// this.pageType = 2;
@ -646,8 +663,21 @@
self.seachBarCode(res.result)
},
fail(res) {
// console.log(res);
uni.redirectTo({
url: '/pages/product/list/index'
})
// uni.showLoading({
// title: '',
// mask: true
// })
// uni.navigateBack()
},
// complete() {
// uni.showLoading({
// title: '',
// mask: true
// })
// }
})
},
isStartsWith6Or06(str) {
@ -655,6 +685,7 @@
return regex.test(str);
},
async seachBarCode(code) {
console.log("laizheer;e1")
if (code.length < 12) {
return Toast('条形码长度不正确, 请重试!')
}
@ -763,6 +794,15 @@
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
onBackPress: function(e) {
uni.redirectTo({
url: '/pages/product/list/index'
})
// uni.navigateBack()
// return false
// this.showlay = true
// return this.go;
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,762 @@
<template>
<view class="container">
<view class="step_one">
<view class="input_content">
<view class="bar-code" v-if="bar_code_dis">
<view>商品条码</view>
<input type="number" placeholder="请手动添加条码" v-model="code" :disabled="bar_code_dis"
placeholder-class="inputPlaceHolder" />
</view>
<view class="input_content_textarea">
<textarea v-model="setFormData.store_name" placeholder="请输入45商品名称"
placeholder-class="placeholderStyle" maxlength="60" />
<view class="flex" style="justify-content: space-between;color: #999999;">
<view>(品牌,名称,规格,口味)</view>
<view>
<text v-if="setFormData.store_name">{{ setFormData.store_name.length }}</text>
<text v-else>0</text>/60
</view>
</view>
</view>
<view class="photo_count">
<text class="photo_size" style="color: #e93323;">建议图片尺寸为750*750px, 上传2张以上</text>
<view class="input_content_photo">
<view class="input_content_photo_adPh" v-for="(item, index) in setFormData.imageList"
:key="index">
<image :src="item" class="myimg2 photos" @click="pop(item)"></image>
<view class="input_content_photo_adPh_jiao" @click="deleteImage(index)">
<image src="../static/images/close.png" mode=""></image>
</view>
</view>
<view v-if="setFormData.imageList.length < 9" class="input_content_photo_adPh addBtn"
@click="clk">
<view>
<image src="../static/images/creamer.png" mode="widthFix"></image>
</view>
<view>添加图片</view>
</view>
</view>
</view>
<u-popup ref="select_popup" class="pop" :show="show" mode="center" closeOnClickOverlay
bgColor='transparent'>
<image :src="image"></image>
<image src="@/static/images/guanbi.png" class="guanbi" @click="close"></image>
</u-popup>
</view>
<!-- 商品详情 -->
<commodityComponent ref="commodityRef" v-if="showCommodity" :key="showCommodity"
:showCommodity="showCommodity" :product_id="product_id" :merId="merId" :code="code">
</commodityComponent>
<view class="popup_group">
<view class="popup_group_item popup_group_item_b" @click="selectPlatform">
<view class="popup_group_item_label">平台分类</view>
<view class="popup_group_item_value">
<view class="popup_group_item_message">
<span v-if="setFormData.cate_name"
class="popup_group_item_message_value">{{ setFormData.cate_name }}</span>
<span v-else>请选择平台分类</span>
</view>
<view><span class="iconfont">&#xe6bd;</span></view>
</view>
</view>
<view class="popup_group_item" @click="selectStoreClass">
<view class="popup_group_item_label ">店铺分类</view>
<view class="popup_group_item_value">
<view class="popup_group_item_message">
<span v-if="setFormData.mer_cate_name"
class="popup_group_item_message_value">{{ setFormData.mer_cate_name }}</span>
<span v-else>请选择店铺分类</span>
</view>
<view><span class="iconfont">&#xe6bd;</span></view>
</view>
</view>
<view class="popup_group_item popup_group_item_b">
<view class="popup_group_item_label">商品单位</view>
<view class="popup_group_item_value"><input v-model="setFormData.unit_name" type="text"
placeholder="请填写商品单位" /></view>
</view>
</view>
<!-- 选择平台分类弹框 -->
<uni-popup ref="select_platform" type="bottom">
<platfrom @close="closePlatfrom" :classifiedData="platformClassificationData"
@getPlatData="getPlatData">
</platfrom>
</uni-popup>
<!-- 选择店铺分类弹框 -->
<uni-popup ref="select_store" type="bottom">
<store-classification :classifiedData="merchantClassification" :mer_id="merId"
@handleGetSelectArea="handleGetSelectStore" @close="merchantClose"></store-classification>
</uni-popup>
<!-- 规格设置 -->
<picker mode="selector" :range="['单规格','多规格']" :value="setFormData.spec_type" @change="changeSpecType">
<view class="popup_group" style="margin-bottom: 0;">
<view class="popup_group_item">
<view class="popup_group_item_label">商品规格</view>
<view class="popup_group_item_value">
<view class="popup_group_item_message">
<span
class="popup_group_item_message_value">{{ setFormData.spec_type==0?'单规格':'多规格' }}</span>
</view>
<view><span class="iconfont">&#xe6bd;</span></view>
</view>
</view>
</view>
<u-modal :show="showSpecType" title="温馨提示" content="切换后商品原有规格将失效,是否继续?" show-cancel-button
confirm-text="继续" @confirm="changeSpecType2" @cancel="showSpecType=false"></u-modal>
</picker>
<priceComponent v-if="setFormData.spec_type==0" :datas="setFormData.attrValue[0]" ref="priceRef"
:product_id="product_id" :bar_code="code" @updateCode="updateCode">
</priceComponent>
<view v-else class="popup_group" style="margin-top: 0;border-top: 1rpx solid #eeeeee;">
<view class="popup_group_item" @click="navToSpecGood()">
<view class="popup_group_item_label" style="flex: 1; text-align: center;">
设置多规格
<text v-if="setFormData.attrValue.length>0">({{setFormData.attrValue.length}})</text>
</view>
</view>
</view>
<view class="popup_group">
<!-- <view class="popup_group_item" @click="showMoreInfo=!showMoreInfo">
<view class="popup_group_item_label">更多信息</view>
<view class="popup_group_item_value" :class="showMoreInfo?'icon_bottom':'icon_top'">
<view><span class="iconfont">&#xe6bd;</span></view>
</view>
</view> -->
<block>
<view class="input_content">
<view class="input_content_describe" style="border: none;padding-bottom: 0;">
<view class="input_content_describe_title">
<view class="input_content_describe_title_msg">商品简介</view>
<view class="input_content_describe_title_num">
<text v-if="setFormData.store_info">{{ setFormData.store_info.length }}</text>
<text v-else>0</text>
/200
</view>
</view>
<view class="input_content_describe_textarea">
<textarea v-model="setFormData.store_info" style="width: 100%;" value=""
placeholder="请填写商品简介" placeholderClass="placeholderClass" maxlength="200" />
</view>
</view>
<!-- <view class="input_content_keyword">
<view class="input_content_keyword_label">关键字</view>
<view class="input_content_keyword_value"><input v-model="setFormData.keyword" type="text" value=""
placeholder="填写关键字" /></view>
</view> -->
</view>
<!-- <view class="input_content">
<view class="input_content_keyword">
<view class="input_content_keyword_label">最少购买件数</view>
<view class="input_content_keyword_value"><input v-model="setFormData.once_min_count" type="number" value=""
placeholder="不限量" /></view>
</view>
</view> -->
<view class="radio">
<view class="radio_label ">送货方式</view>
<checkbox-group class="select_group flex_start" @change="changeDelivery">
<label class="radio_select" v-for="(val, i) in deliveryFreeList" :key="val.value">
<view>
<checkbox :value="val.value"
:checked="setFormData.delivery_way.includes(val.value+'')" />
</view>
<view>{{ val.name }}</view>
</label>
</checkbox-group>
</view>
</block>
</view>
</view>
<view class="handle">
<view class="handle_button" @click="submitCreatedGoods">提交</view>
</view>
<!-- 图片选择器 -->
<avatar @upload="doUpload" @getName="getImgName" quality="1" ref="avatar" selWidth="250upx" selHeight="250upx">
</avatar>
</view>
</template>
<script>
import {
TOKENNAME,
HTTP_REQUEST_URL
} from '@/config/app.js';
import {
categoryBrandlist,
categorySelect,
storeClassifyLst,
categoryList,
attrList,
templateList,
productDetail,
getDeliveryType,
productCreate,
productUpdate
} from '@/api/product.js';
import {
serialize,
Toast,
Loading,
hideLoading,
Modal
} from "@/libs/uniApi.js";
import avatar from "@/components/yq-avatar/yq-avatar.vue";
import platfrom from "./components/platform.vue";
import storeClassification from '../components/store_classification.vue';
import commodityComponent from "./components/commodity.vue";
import priceComponent from "./components/price.vue";
export default {
components: {
avatar,
platfrom,
commodityComponent,
priceComponent,
storeClassification
},
data() {
return {
bar_code_dis: false,
merId: '', //id
product_id: '', //id
import: 0, //
code: '', //
show: false, //
image: false, //
setFormData: {
store_name: '',
imageList: [],
attrValue: [],
cate_name: '', //
unit_name: '', //
cate_id: '', // id
mer_cate_id: '', //
mer_cate_name: '', //
spec_type: '0', // 0. 1
attr: [], //
specifica: '', //
// setSpecificaValue: '', //
// setSpecificaValue2: '',
delivery_way: ['1', '2'], // 1 2
delivery_free: '1', // 0 1
temp_id: '', // ID
tempName: '', //
once_min_count: '', //
},
platformClassificationData: [], //
merchantClassification: [], //
brand: [], //
showCommodity: false, // ,
deliveryFreeList: [{
value: '1',
name: '到店核销'
},
{
value: '2',
name: '快递配送'
}
],
//
classified: {
cate_id: [],
mer_cate_id: [],
brand_id: [],
attr: [],
temp_id: []
},
productItem: {} || [],
showSpecType: false, //
spec_type: 0, //,0,1
};
},
onLoad(opt) {
this.merId = Number(opt.mer_id);
this.product_id = opt.product_id;
this.import = opt.import;
// if (!opt.product_id) this.showCommodity = true;
this.showCommodity = true;
this.initData();
if (this.import == 1) {
this.getOpenerEventChannel().once('importAttrValue', (e) => {
this.attrValue = e.attrValue;
uni.setStorageSync('attrValue', JSON.stringify(e.attrValue));
this.attr = e.attr;
uni.setStorageSync('attr', JSON.stringify(e.attr));
this.setFormData = Object.assign({}, this.setFormData, e);
this.$nextTick(() => {
this.$refs.commodityRef?.setDatas({
addGoodsSecoundData: {
is_good: this.setFormData.is_good, //
is_gift_bag: this.setFormData.is_gift_bag,
sort: this.setFormData.sort,
once_count: this.setFormData.once_count, //
video_link: this.setFormData.video_link,
},
goodsDis: {
store_name: this.setFormData.content?.title,
imageList: this.setFormData.content?.image
}
})
})
})
} else if (this.product_id) {
this.initDataEditData();
}
},
onBackPress() {},
onShow() {
this.initClasiffy();
// this.setFormData = Object.assign(this.setFormData, {
// "store_name": "",
// "imageList": [
// "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/457c6202311181745387896.jpeg",
// "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/185e2202311181745434402.jpeg"
// ],
// "cate_name": "",
// "unit_name": "",
// "cate_id": 445,
// "keyword": "22"
// })
// this.$nextTick(async () => {
// await this.$u.sleep(200)
// this.$refs.commodityRef.addGoodsSecoundData = {
// "is_good": 1,
// "is_gift_bag": 0,
// "sort": "20",
// "once_count": "",
// "video_link": "https://lihai001.oss-cn-chengdu.aliyuncs.com/media/7ce3d202311181816166215.mp4"
// }
// this.$refs.commodityRef.goodsDis = {
// "store_name": "",
// "imageList": [
// "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/fb73d202311181751262661.png"
// ]
// }
// this.$refs.priceRef.singleSpecification = {
// "price": "1",
// "cost": "1",
// "stock": "11",
// "ot_price": "",
// "wholesale_price": "",
// "bar_code": "666",
// "weight": "10",
// "volume": "5",
// "image": "",
// "extension_one": "",
// "extension_two": ""
// }
// })
},
beforeDestroy() {},
watch: {
'setFormData.imageList'(val) {
this.setFormData.image = val.length ? val[0] : '';
this.setFormData.slider_image = val.length ? serialize(val).splice(1) : [];
}
},
methods: {
changeDelivery(e) {
this.setFormData.delivery_way = e.detail.value;
},
//
initDataEditData() {
this.setFormData = {
imageList: [],
attrValue: [],
specification: '',
image: '', //
slider_image: '', //
store_name: '', //
store_info: '', //
keyword: '', //
brand_id: '', // id
brand_name: '', //
cate_id: '', //
cate_name: '', //
mer_cate_id: '', //
mer_cate_name: '', //
unit_name: '', //
spec_type: '0', // 0. 1
attr: [], //
specifica: '', //
// setSpecificaValue: '', //
// setSpecificaValue2: '', //
delivery_way: [], // 1 2
delivery_free: '0', // 0 1
temp_id: '', // ID
tempName: '', //
once_min_count: '', //
};
productDetail(this.merId, this.product_id).then(async (res) => {
this.showCommodity = true;
if (res.data.content_arr && res.data.content_arr.length > 0) res.data.content = res.data
.content_arr;
let editGoodsDetils = res.data;
Object.keys(this.setFormData).forEach(item => {
this.setFormData[item] = editGoodsDetils[item];
});
this.setFormData.product_id = this.product_id;
this.setFormData.imageList = [...(this.setFormData.image ? [this.setFormData.image] : []),
...
this
.setFormData.slider_image
];
this.setFormData.cate_name = editGoodsDetils?.storeCategory?.cate_name; //
this.setFormData.mer_cate_name = editGoodsDetils.merCateId ? editGoodsDetils.merCateId.map(
item => item
.category && item.category.cate_name).join(',') : '';
this.setFormData.brand_name = editGoodsDetils.brand ? editGoodsDetils.brand.brand_name :
'';
if (res.data.content && typeof res.data.content == 'string') res.data.content = JSON.parse(
res.data
.content);
this.setFormData.once_min_count <= 0 ? this.setFormData.once_min_count = '' : null;
this.setFormData.delivery_way = res.data.delivery_way;
//
this.$nextTick(() => {
this.$refs.commodityRef.setDatas({
addGoodsSecoundData: {
is_good: res.data.is_good, //
is_gift_bag: res.data.is_gift_bag,
sort: res.data.sort,
once_count: res.data.once_count, //
video_link: res.data.video_link,
},
goodsDis: {
store_name: res.data.content?.title,
imageList: res.data.content?.image
}
})
//
if (this.setFormData.spec_type == 0) {
this.$refs.priceRef.setDatas(res.data.attrValue[0]);
}
})
editGoodsDetils.temp && (this.setFormData.tempName = editGoodsDetils.temp.name);
hideLoading();
});
},
//
async initClasiffy() {
this.merchantClassification = (await storeClassifyLst(this.merId)).data;
},
initData() {
//
categoryBrandlist(this.merId).then((res) => {
this.brand = res.data;
}).catch(e => {
console.log(e);
});
//
categoryList(this.merId).then((res) => {
res.data.forEach((item1) => {
item1.children.forEach((item2) => {
item2.children = null;
})
})
this.platformClassificationData = res.data;
}).catch(e => {
console.log(e);
})
},
//
updateCode(e) {
this.code = e + '';
},
//
handleChooseImage() {
let that = this;
that.$util.uploadImageOne('upload/image', function(res) {
that.setFormData.imageList.push(res.data.path);
});
},
clk() {
// let avatar = this.$refs.avatar;
// avatar.fChooseImg(1, {
// selWidth: '350upx',
// selHeight: '350upx',
// inner: true
// });
this.$util.uploadImageOne({
url: 'upload/image',
crop: {
width: 2000,
height: 2000,
}
}, (res) => {
this.setFormData.imageList.push(res.data.path);
});
},
doUpload(rsp) {
let that = this
// console.log(rsp);
uni.uploadFile({
url: HTTP_REQUEST_URL + '/api/upload/image/field',
filePath: rsp.path,
name: 'field',
formData: {
'filename': rsp.path,
'name': that.imgName
},
header: {
// #ifdef MP
"Content-Type": "multipart/form-data",
// #endif
[TOKENNAME]: 'Bearer ' + this.$store.state.app.token
},
success: (uploadFileRes) => {
// console.log(uploadFileRes.data);
let imgData = JSON.parse(uploadFileRes.data)
that.setFormData.imageList.push(imgData.data.path)
},
complete(res) {
// console.log(res)
}
});
},
getImgName(name) {
this.imgName = name
},
//
pop(e) {
this.show = true
this.image = e
},
//
close() {
this.$refs.select_popup.close();
this.show = false
},
//
deleteImage(index) {
this.setFormData.imageList.splice(index, 1);
},
//
selectPlatform() {
this.$refs.select_platform.open();
},
//
closePlatfrom() {
this.$refs.select_platform.close();
},
//
getPlatData(item, taplist) {
this.setFormData.cate_id = item.value;
this.setFormData.cate_name = item.label;
this.$refs.select_platform.close();
},
//
selectStoreClass() {
this.$refs.select_store.open();
},
//
merchantClose() {
this.$refs.select_store.close();
},
//
handleGetSelectStore(item) {
console.log(item);
this.setFormData.mer_cate_id = item.map(val => val.store_category_id);
this.setFormData.mer_cate_name = item.map(val => val.cate_name).join(',');
this.$refs.select_store.close();
},
//
selectBrand() {
this.$refs.select_popup.open();
},
//
getLinkageData(item) {
this.setFormData.brand_id = item[0].value;
this.setFormData.brand_name = item[0].cate_name;
this.$refs.select_popup.close();
},
//
multipleList(data, model) {
if (model == 'mer_cate_id') {
this.platformClassification[1].value = data.map(item => item.label).join('');
this.platformClassification[1].allreadySelect = data;
this.setFormData.mer_cate_id = data.map(item => item.value);
}
},
// popup
//
close() {
this.$refs.select_popup.close();
this.show = false
},
//
getLinkDataOfRecursion(arr, child = 'children', key = 'value') {
let str = '';
let id = '';
arr.forEach(item => {
str = item.label;
id = item.value;
});
// str = str.slice(0, str.length - 1);
return {
str,
id
};
},
//
getTemplateList() {
templateList(this.merId, this.templateListPage).then(res => {
res.data.list.forEach(item => {
this.$set(item, 'value', item.shipping_template_id);
this.$set(item, 'label', item.name);
});
this.classified['temp_id'] = res.data.list;
this.$refs.tempId.open();
});
},
//
submitCreatedGoods() {
console.log('创建商品');
// return console.log('', this.setFormData.attr);
console.log('是否推荐', this.$refs.commodityRef.addGoodsSecoundData);
console.log('商品详情', this.$refs.commodityRef.goodsDis, this.$refs.commodityRef.store_name);
if (this.setFormData.spec_type == 0) {
console.log('价格库存', this.$refs.priceRef.singleSpecification);
}
if (this.setFormData.delivery_way.length == 0) return Toast('请至少选择一种送货方式');
let postData = {
...this.setFormData,
...this.$refs.commodityRef.addGoodsSecoundData,
content: {
title: this.$refs.commodityRef.goodsDis?.store_name || '',
image: this.$refs.commodityRef.goodsDis?.imageList || []
},
video_link: this.$refs.commodityRef.addGoodsSecoundData.video_link,
};
if (this.setFormData.spec_type == 0) {
postData.attrValue = [this.$refs.priceRef.singleSpecification];
} else postData.attrValue = this.setFormData.attrValue;
postData.stock = postData.attrValue[0]?.stock || 0;
if (!postData.store_name || postData.store_name?.trim().length <= 0) return Toast('请输入商品名称');
if (!postData.imageList || postData.imageList?.length < 2) return Toast('请上传2张以上商品图片');
if (!postData.cate_name || postData.cate_name?.trim().length <= 0) return Toast('请选择平台分类');
if (!postData.unit_name || postData.unit_name?.trim().length <= 0) return Toast('请输入商品单位');
let userInfo = this.$store.state.app.userInfo;
if (typeof userInfo == 'string') userInfo = JSON.parse(userInfo);
let showFlag = '';
console.log(postData);
postData.attrValue.forEach(t => {
if (userInfo.mer_info.wholesale && (!t.wholesale_price || +t.wholesale_price <= 0)) {
showFlag = '批发价不能小于0'
}
if (!t.price || +t.price <= 0) showFlag = '零售价不能小于0';
if (!t.stock || +t.stock <= 0) showFlag = '库存不能小于0';
// if (!t.cost || +t.cost <= 0) showFlag = '0';
})
if (showFlag) {
if (this.setFormData.spec_type == 1) showFlag += ', 请点击设置多规格设置';
return Toast(showFlag);
}
Loading();
if (this.product_id) {
productUpdate(this.merId, this.product_id, postData)
.then(res => {
hideLoading()
Modal('提交成功', '点击确定, 前往商品列表页面').then(() => {
uni.redirectTo({
url: `/pages/product/goodsOnSale/index?mer_id=${this.merId}&type=6`
})
}).catch(() => {
uni.navigateBack()
})
})
.catch(rej => {
Toast(rej);
});
} else {
productCreate(this.merId, postData)
.then(res => {
hideLoading();
Modal('提交成功', '点击确定,前往商品列表页面').then(() => {
if (this.import == 1) {
uni.$emit('importAttrValueOK', this.setFormData.import_id);
uni.navigateBack();
} else uni.redirectTo({
url: `/pages/product/goodsOnSale/index?mer_id=${this.merId}&type=6`
})
}).catch(() => {
uni.navigateBack()
})
})
.catch(rej => {
Toast(rej);
});
}
},
//
changeSpecType(e) {
if (this.setFormData.spec_type != e.detail.value) {
this.showSpecType = true;
}
this.spec_type = e.detail.value;
},
//
changeSpecType2() {
this.showSpecType = false;
this.setFormData.spec_type = this.spec_type + '';
this.setFormData.attrValue = [];
this.setFormData.attr = [];
},
//
navToSpecGood() {
uni.navigateTo({
url: '/pages/product/addGood/specGood?product_id=' + this.product_id,
success: (e) => {
// console.log(this.setFormData.attrValue, e);
e.eventChannel.emit('updateAttrValue', {
attrValue: JSON.parse(JSON.stringify(this.setFormData.attrValue)),
attr: JSON.parse(JSON.stringify(this.setFormData.attr))
});
uni.$once('updateSpecType', (e) => {
this.setFormData.attrValue = JSON.parse(JSON.stringify(e.attrValue));
this.setFormData.attr = JSON.parse(JSON.stringify(e.attr));
})
}
})
}
}
};
</script>
<style lang="scss" scoped>
@import './scss/index.scss';
.pop {
z-index: 1;
}
.guanbi {
width: 20px;
height: 20px;
margin: 30px auto;
}
</style>

View File

@ -5,10 +5,13 @@
<view class="content_list_item">
<view>商品详情</view>
</view>
<input-goods-detils class="input-goods-detils" @getProductContent="getProductContent" :title="store_name" :prodectContent="goodsDis" :maxLength="200"></input-goods-detils>
<input-goods-detils class="input-goods-detils" @getProductContent="getProductContent" :title="store_name"
:prodectContent="goodsDis" :maxLength="200"></input-goods-detils>
<block v-if="!moreThanFlag">
<view class="content_list_video input-goods-detils">
<view class="content_list_video_title">商品视频</view>
<view class="video_list">
<view class="video_list_item photo" v-if="addGoodsSecoundData.video_link">
<view class="jiao" @click="deleteImage()">
@ -46,13 +49,15 @@
<view>添加视频</view>
</view>
</view>
</view>
<view class="container_input marginTop_none input-goods-detils">
<view class="container_input_item">
<view class="container_input_item_label"><span>是否推荐</span></view>
<view class="container_input_item_value">
<switch :checked="addGoodsSecoundData.is_good == 1" color="#E93323" style="transform:scale(0.8)"
@change="isGood" />
<switch :checked="addGoodsSecoundData.is_good == 1" color="#E93323"
style="transform:scale(0.8)" @change="isGood" />
</view>
</view>
<!-- <view class="container_input_item">
@ -103,7 +108,10 @@
</view>
</template>
<script>
import { TOKENNAME, HTTP_REQUEST_URL } from '@/config/app.js';
import {
TOKENNAME,
HTTP_REQUEST_URL
} from '@/config/app.js';
import store from 'store';
import {
navigateTo,
@ -116,7 +124,10 @@
hideLoading,
Modal
} from '@/libs/uniApi.js';
import { productCreate, productUpdate } from 'api/product.js';
import {
productCreate,
productUpdate
} from 'api/product.js';
import inputGoodsDetils from './inputGoodsDetils.vue';
export default {
components: {
@ -157,14 +168,16 @@
once_count: '', //
video_link: ''
},
goodsDis: {imageList: [],store_name:""},
goodsDis: {
imageList: [],
store_name: ""
},
store_name: '',
moreThanFlag: true,
};
},
mounted() {
},
mounted() {},
methods: {
videoshow() {
this.showVideo = true
@ -191,7 +204,9 @@
},
//
inputGoodsDetils() {
navigateTo(1, '/pages/product/addGoods/addGoodDetils', { mer_id: this.merId });
navigateTo(1, '/pages/product/addGoods/addGoodDetils', {
mer_id: this.merId
});
},
//
uploadVideo() {
@ -206,9 +221,9 @@
filePath: res.tempFilePath,
name: 'file',
//
formData: {
user: 'test'
},
// formData: {
// user: 'test'
// },
header: {
// #ifdef MP
'Content-Type': 'multipart/form-data',

View File

@ -0,0 +1,77 @@
<template>
<view class="">
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
:maxCount="10"></u-upload>
</view>
</template>
<script>
import {
TOKENNAME,
HTTP_REQUEST_URL
} from '@/config/app.js';
export default {
data() {
return {
fileList1: [],
}
},
methods: {
//
deletePic(event) {
this[`fileList${event.name}`].splice(event.index, 1)
},
//
async afterRead(event) {
// multiple true , file
let lists = [].concat(event.file)
let fileListLen = this[`fileList${event.name}`].length
lists.map((item) => {
this[`fileList${event.name}`].push({
...item,
status: 'uploading',
message: '上传中'
})
})
for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url)
let item = this[`fileList${event.name}`][fileListLen]
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
status: 'success',
message: '',
url: result
}))
fileListLen++
}
},
uploadFilePromise(url) {
return new Promise((resolve, reject) => {
let a = uni.uploadFile({
url: HTTP_REQUEST_URL + '/api/upload/image/field',
filePath: url,
// formData: {
// 'filename': rsp.path,
// 'name': that.imgName
// },
header: {
// #ifdef MP
"Content-Type": "multipart/form-data",
// #endif
[TOKENNAME]: 'Bearer ' + this.$store.state.app.token
},
success: (res) => {
setTimeout(() => {
resolve(res.data.data)
}, 1000)
}
});
})
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,941 @@
<template>
<view class='content'>
<u--form :model="formData" :rules="rules" ref="formData" :labelStyle="{fontSize:'32rpx',color:'#444444'}"
labelWidth='auto'>
<view class="good-baseInfo card">
<u-form-item label="商品标题" prop="store_name" ref="item1" required>
<text slot='right'
style="font-size:28rpx ; color:#989898 ;">{{stroeNameLength}}/{{maxLength}}</text>
</u-form-item>
<u-form-item label="" prop="userInfo.name" ref="item1">
<u--textarea v-model="formData.store_name" placeholder="建议描述产品品牌、名称、规格、口味"
style="background-color: #F9F9F9;height: 166rpx;" :maxlength='maxLength'></u--textarea>
</u-form-item>
<u-form-item label="商品主图" prop="formData.imageList" ref="item1" required>
<text style="color: #E18C34;font-size: 24rpx">上传时应注重真实性清晰度</text>
</u-form-item>
<view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;">
<view class="" style="display: flex;flex-wrap: wrap;">
<view v-for="(item,index) in formData.imageList"
style="margin-right: 20rpx;margin-bottom: 20rpx;">
<view class="video_list" v-if='vidioTypeList.includes(getSuffix(item))'>
<view class="video_list_item photo" style="position: relative;">
<view class="jiao">
<!-- video标签在app端层级过高 -->
<!--#ifndef APP-PLUS-->
<video :src="item"></video>
<!--#endif-->
<!--#ifdef APP-PLUS-->
<view class="" style="position: relative;">
<img :src="item+coverUrl" style=" width:140rpx;height: 140rpx;"></img>
<view class="image-play-icon">
<u-icon name="play-right-fill" size="30" color="white"></u-icon>
</view>
</view>
<!--#endif-->
<image @click="formData.imageList.splice(index,1)"
src="@/static/images/gban.png" mode="widthFix"></image>
</view>
<view style="position: absolute;top: 20rpx;z-index: 99;width: 140rpx;height: 100%;"
@click="videoshow(index)">
<view class="videoHover">
</view>
</view>
</view>
</view>
<view class="" style="position: relative;" v-else>
<view class="jiao" @click="formData.imageList.splice(index,1)">
<image src="@/static/images/gban.png" mode="widthFix"></image>
</view>
<u--image @click="preViewImg(item)" :src="item" :fade="true" duration="450"
width='140rpx' height='140rpx'></u--image>
</view>
</view>
<view class='uploadimg' @click="show=true,isDetail=false">
<u-icon name="plus" color="#777777"></u-icon>
<view class="" style="color: #777777;font-size: 20rpx;">
上传图片/视频
</view>
</view>
</view>
</view>
<u-form-item label="商品详情" prop="formData.content.image" required>
<text style="color: #E18C34;font-size: 24rpx">上传时应注重真实性清晰度</text>
</u-form-item>
<view class="card" style="min-height: 150rpx;margin-bottom: 0;padding: 0;">
<view class="" style="display: flex;flex-wrap: wrap;">
<view v-for="(item,index) in formData.content.image"
style="margin-right: 20rpx;margin-bottom: 20rpx;">
<view class="video_list" v-if='vidioTypeList.includes(getSuffix(item))'>
<view class="video_list_item photo" style="position: relative;">
<view class="jiao" @click="formData.content.image.splice(index,1)">
<!-- video标签在app端层级过高 -->
<!--#ifndef APP-PLUS-->
<video :src="item"></video>
<!--#endif-->
<!--#ifdef APP-PLUS-->
<view class="" style="position: relative;">
<img :src="item+coverUrl" style=" width:140rpx;height: 140rpx;"></img>
<view class="image-play-icon">
<u-icon name="play-right-fill" size="30" color="white"></u-icon>
</view>
</view>
<!--#endif-->
<image src="@/static/images/gban.png" mode="widthFix"></image>
</view>
<view style="position: absolute;top: 20rpx;z-index: 99;width: 140rpx;height: 100%;"
@click="videoshow(index)">
<view class="videoHover">
</view>
</view>
</view>
</view>
<view class="" style="position: relative;" v-else>
<view class="jiao" @click="formData.content.image.splice(index,1)">
<image src="@/static/images/gban.png" mode="widthFix"></image>
</view>
<u--image @click="preViewImg(item)" :src="item" :fade="true" duration="450"
width='140rpx' height='140rpx'></u--image>
</view>
</view>
<view class='uploadimg' @click="show=true,isDetail=true">
<u-icon name="plus" color="#777777"></u-icon>
<view class="" style="color: #777777;font-size: 20rpx;">
上传图片/视频
</view>
</view>
</view>
</view>
</view>
<view class='tips'>
商品类目属性
</view>
<view class="card" style="padding: 14rpx 30rpx;">
<u-form-item label="商品分类" prop="cate_name" ref="item1" labelPosition="left" required>
<view style="display: flex;align-items: center;font-size: 28rpx;color:#777777 ;" slot="right"
@click="navgo(`/pages/product/addGoodDetail/goodsType?mer_id=${mer_id}&&formData=${JSON.stringify(formData)}`)">
<view style="margin-right: 10rpx;line-height: 25rpx;">{{ formData.cate_name|| '请选择'}}</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item label="商品属性" prop="userInfo.name" ref="item1" labelPosition="left">
<view style="display: flex;align-items: center;font-size: 28rpx;color:#777777 ;" slot="right"
@click="navgo(`/pages/product/addGoodDetail/goodsAttr?mer_id=${mer_id}&&formData=${JSON.stringify(formData)}`)">
<view style="margin-right: 10rpx;line-height: 25rpx;">
{{isSet(formData.product_attribute)?'已设置':'未设置' }}
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
</view>
<view class='tips'>
规格与价格
</view>
<view class="card" style="min-height: 100rpx;padding: 14rpx 30rpx;">
<u-form-item label="规格与价格" prop="formData.attrValue" ref="item1" labelPosition="left" required>
<view style="display: flex;align-items: center;font-size: 28rpx;color:#777777 ;" slot="right"
@click="navgo(`/pages/product/addGoodDetail/goodsPrice?formData=${JSON.stringify(formData)}&&mer_id=${mer_id}`)">
<view style="margin-right: 10rpx;line-height: 25rpx;">{{sets?"已设置":""}}
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<view class="" v-if="showSet">
<view class="" v-for="(item,index) in formData.attrValue.filter(item=> item.is_use==0)">
<view class="" v-if='formData.attrValue.filter(item=> item.is_use==0).length==1'>
<u-form-item label="零售价格" label-width="auto" labelPosition="left" border-bottom>
<view style="font-size: 28rpx;color:#777777 ;width: 100%;text-align: right;">
{{item.price}}/{{item.unit_name}}
</view>
</u-form-item>
<u-form-item v-if='isWholeSale' label="批发价格" label-width="auto" labelPosition="left"
border-bottom>
<view style="font-size: 28rpx;color:#777777 ;width: 100%;text-align: right;">
{{item.wholesale_price}}/{{item.wholesale_unit_name}}
</view>
</u-form-item>
<u-form-item label="商品库存" label-width="auto" labelPosition="left" border-bottom>
<view style="font-size: 28rpx;color:#777777 ;width: 100%;text-align: right;">
{{item.stock}}
</view>
</u-form-item>
</view>
<view class="" v-else>
<u-form-item :label="item.sku" label-width="350rpx" prop="userInfo.name" ref="item1"
labelPosition="left" border-bottom>
<view class="" style="display: flex;justify-content: space-between;width: 100%">
<view style="font-size: 28rpx;color:#777777 ;">
零售价
</view>
<view style="font-size: 28rpx;color:#777777 ;">
{{item.price}}/{{item.unit_name}}
</view>
</view>
</u-form-item>
<u-form-item label=" " label-width="350rpx" prop="userInfo.name" ref="item1"
labelPosition="left" border-bottom v-if='isWholeSale'>
<view class="" style="display: flex;justify-content: space-between;width: 100%">
<view style="font-size: 28rpx;color:#777777 ;">
批发价
</view>
<view style="font-size: 28rpx;color:#777777 ;">
{{item.wholesale_price}}/{{item.wholesale_unit_name}}
</view>
</view>
</u-form-item>
</view>
</view>
</view>
</view>
<view class='tips'>
</view>
<view class="card" style="padding: 14rpx 30rpx;">
<u-form-item label="商品详细描述" prop="userInfo.name" ref="item1" labelPosition="left">
<text slot='right' style="font-size:28rpx ; color:#989898 ;">{{storeInfoLength}}/{{300}}</text>
</u-form-item>
<u--textarea v-model="formData.store_info" placeholder="货品描述请严格遵循《广告法》规定,避免出现虚假宣传和误导消费者的词语"
style="background-color: #F9F9F9;height: 166rpx;" :maxlength='300'></u--textarea>
<u-line color="#F3F3F3" style="margin: 30rpx 0;"></u-line>
<u-form-item label="送货方式" labelPosition="left" prop='delivery_way' required>
<u-checkbox-group v-model="formData.delivery_way" placement="row" slot="right">
<u-checkbox shape="circle" v-for="(item, index) in checkboxList1" :key="index"
:label="item.name" :name="item.value" activeColor="#20B128"
:customStyle="{marginRight: '8px'}"
:labelColor="checkboxValue1.includes(item.name)?'#20B128':'#777777'">
</u-checkbox>
</u-checkbox-group>
</u-form-item>
</view>
</u--form>
<view class="submit-btn">
<u-button text="确认发布" @click="submit" color="#33BB3C" class="custom-style"></u-button>
</view>
<view class="overlay">
<u-overlay :show="showlay">
<view class="overlay-content">
<view class="">
温馨提示
</view>
<view class="" style="font-size: 36rpx;">
发布中断可能导致商机流失
</view>
<view class="" style="font-size: 26rpx;color: #777777;">
<view class="">
您的商品信息已经填写了大半
</view>
<view class="">
只差最后几步就能上架销售了
</view>
</view>
<view class=""
style="font-size: 28rpx;color: #444444;background-color: #EDF8ED;padding: 20rpx 44rpx;border-radius: 12rpx;">
<view class="">
越早发布产品<text style='color: #21B129;'>曝光量越高</text>
</view>
<view class="">
越早发布产品可提前 <text style='color: #21B129;'>抢占商机</text>
</view>
</view>
<view style="display: flex;">
<view style="width: 236rpx;height: 84rpx;margin-right: 30rpx;">
<u-button text="确定返回" @click='back'></u-button>
</view>
<view style="width: 236rpx;height: 84rpx;">
<u-button type='primary' text="继续编辑" @click='showlay=false'></u-button>
</view>
</view>
</view>
</u-overlay>
</view>
<u-picker :show="show" :columns="columns" confirmColor='#33BB3C' @close='show=false' @confirm='choseMedia'
@cancel='show=false'></u-picker>
<view v-if="showVideo" class="video-count">
<video id="myVideo" class="videoLink" autoplay loop muted
:src=" isDetail?formData.content.image[videoIndex]: formData.imageList[videoIndex]"></video>
</view>
<view class='mask' catchtouchmove="true" :hidden='showVideo==false' @tap="showVideo=false"></view>
</view>
</template>
<script>
import {
Toast,
Modal
} from "@/libs/uniApi.js";
import {
HTTP_REQUEST_URL,
TOKENNAME
} from '@/config/app.js';
import store from 'store';
import {
productCreate,
productUpdate,
productDetail
} from '@/api/product.js';
import uploadImgVideo from "../addGood/components/uploadImgVideo.vue"
import form from "../../../uni_modules/uview-ui/libs/config/props/form";
export default {
components: {
uploadImgVideo,
},
data() {
return {
coverUrl: '?spm=a2c4e.11153940.blogcont573781.6.c1032027sQ46VG&x-oss-process=video/snapshot,t_1000,m_fast',
mode: 'add',
isDetail: false,
columns: [
['图片', '视频', ]
],
sets: false,
showVideo: false,
vidioTypeList: ['mp4', 'avi', 'mov', 'wmv', 'mkv', 'flv', 'mpeg', '3gp', 'webm'],
videoIndex: 0,
upload_max: 100,
uploadUrl: `${HTTP_REQUEST_URL}/api/upload/video`,
show: false, //
showSet: false,
delivery_way: [],
isWholeSale: false,
formData: {
store_info: "",
product_id: "",
"store_name": "",
"imageList": [
],
attr: [{
detail: [{
attr: 'name'
}],
value: " "
}, ],
"attrValue": [{
detail: {
},
"price": "",
"unit_name": "",
"wholesale_unit_name": "",
"wholesale_price": '',
"cost": "",
"stock": "",
sku: '',
"ot_price": "",
"procure_price": "",
"bar_code": "",
"weight": "",
"extension_one": "",
"extension_two": "",
uuid: "",
volume: "",
"is_use": 0,
}],
"cate_name": "",
"unit_name": "",
"cate_id": '',
"mer_cate_id": [
],
"mer_cate_name": "",
"spec_type": "",
"specifica": "",
"delivery_way": [
],
"delivery_free": "1",
"temp_id": "",
"tempName": "",
"once_min_count": "",
"image": "",
"slider_image": [
""
],
"is_good": 0,
"is_gift_bag": 0,
"sort": "",
"once_count": "",
"video_link": "",
"content": {
"title": "",
"image": []
},
"stock": "",
product_attribute: {
address: "",
leval: "",
pack: "",
attr: [{
label: "",
value: ''
}]
}
},
mer_id: "",
maxLength: 30,
fileList6: [],
showSex: false,
showlay: false,
go: true,
model1: {
userInfo: {
name: '',
sex: '',
},
},
range: [{
value: 0,
text: "篮球"
},
{
value: 1,
text: "足球"
},
{
value: 2,
text: "游泳"
},
],
text: "",
text1: "",
value1: "",
checkboxValue1: [],
checkboxList1: [{
name: '到店核销',
value: '1',
},
{
name: '快递配送',
value: '2',
},
],
attrRules: {
price: '单价不能为空',
unit_name: '计量单位不能为空',
wholesale_price: '批发价格不能为空',
wholesale_unit_name: '批发单位不能为空',
stock: '库存不能为空'
},
rules: {
"formData.imageList": [{
validator: (rule, value, callback) => {
return this.formData.imageList.length >= 2
},
message: '请至少上传2张图片',
trigger: ['change', 'blur'],
}],
"formData.attrValue": [{
validator: (rule, value, callback) => {
if (!this.isWholeSale) {
delete this.attrRules.wholesale_unit_name
delete this.attrRules.wholesale_price
}
let errList = []
this.formData.attrValue.forEach(item => {
for (let key in this.attrRules) {
if (!item[key]) {
errList.push(this.rules[key])
}
}
})
return errList.length == 0
},
message: '请填写完整商品规格',
trigger: ['change', 'blur'],
}],
'store_name': {
type: 'string',
required: true,
message: '请填写商品标题',
trigger: ['blur', 'change']
},
'cate_name': {
type: 'string',
required: true,
message: '请填写商品分类',
trigger: ['blur', 'change']
},
'delivery_way': {
validator: (rule, value, callback) => {
return this.formData.delivery_way.length > 0
},
required: true,
message: '请选择送货方式',
trigger: ['blur', 'change']
},
'formData.content.image': {
validator: (rule, value, callback) => {
return this.formData.content.image.length > 0
},
required: true,
message: '请上传商品详情图',
trigger: ['blur', 'change']
},
},
radio: '',
switchVal: false
};
},
computed: {
stroeNameLength() {
return this.formData.store_name?.length || 0
},
storeInfoLength() {
return this.formData.store_info?.length || 0
}
},
methods: {
test(index) {
// this.formData.imageList.splice(index, 1)
console.log(this.formData, index)
},
preViewImg(url) {
let that = this
uni.previewImage({
urls: [url],
});
},
deleteImage(index) {
// this.addGoodsSecoundData.video_link = '';
},
videoshow(index) {
this.videoIndex = index
this.showVideo = true
this.videoContext = uni.createVideoContext('myVideo', this);
this.$nextTick(() => {
this.videoContext.play();
})
},
getSuffix(url) {
const str = url;
const lastIndex = str.lastIndexOf(".");
if (lastIndex !== -1) {
const extension = str.substring(lastIndex + 1);
return extension
} else {
return 'asdasdsadsd'
}
},
choseMedia(e) {
console.log(e.value)
this.show = false
if (e.value[0] == '图片') {
this.handleChooseImage()
} else {
this.uploadVideo()
}
},
//
handleChooseImage() {
let that = this;
that.$util.uploadImages({
count: 6,
url: 'upload/image'
}, function(res) {
if (that.isDetail) {
that.formData.content.image.push(res.data.path.replace(
/\\/g, ""));
} else {
that.$set(that.formData.imageList, that.formData.imageList.length, res.data.path.replace(
/\\/g,
""));
}
// that.formData.imageList.push(res.data.path);
});
},
//
uploadVideo() {
let that = this
uni.chooseVideo({
sourceType: ['camera', 'album'],
success: res => {
uni.showLoading({
title: '正在上传中。。。'
});
if (Math.ceil(res.size / 1024) < this.upload_max * 1024) {
uni.uploadFile({
url: this.uploadUrl, //
filePath: res.tempFilePath,
name: 'file',
header: {
// #ifdef MP
'Content-Type': 'multipart/form-data',
// #endif
[TOKENNAME]: 'Bearer ' + store.state.app.token
},
success: uploadFileRes => {
uni.hideLoading();
let data = JSON.parse(uploadFileRes.data);
if (that.isDetail) {
that.formData.content.image.push(data.data.src.replace(
/\\/g, ""));
} else {
that.formData.imageList.push(data.data.src.replace(/\\/g,
""))
}
},
complete: a => {
// console.log(a);
}
});
} else {
uni.showModal({
title: '提示',
content: `视频超出限制${this.upload_max}MB,已过滤`
});
}
},
fail: err => {
console.log(err)
}
});
},
isSet(obj) {
for (let key in obj) {
if (typeof obj[key] == 'object') this.isSet(obj[key])
else {
if (Boolean(obj[key])) return 'true12';
}
}
},
isSet2(obj) {
let lists = ['unit_name', 'price', 'wholesale_price', 'stock']
lists.forEach(item => {
if (Boolean(this.formData.attrValue[0][item])) {
this.sets = true
}
})
},
sexSelect(e) {
this.model1.userInfo.sex = e.name
this.$refs.uForm.validateField('userInfo.sex')
},
navgo(url) {
uni.navigateTo({
url
})
},
back() {
// console.log('show')
this.go = false
uni.navigateBack()
},
showlayFn() {
uni.navigateBack()
},
// submit() {
// console.log(this.formData)
// },
getAttr(object) {
this.formData.product_attribute = object
},
getAttrValue(object) {
this.formData.attrValue = object
},
async handAdd() {
let that = this
let data = uni.$u.deepClone(this.formData)
data.image = data.imageList.find(item => {
return !this.vidioTypeList.includes(this.getSuffix(item))
})
data.slider_image = this.formData.imageList.filter((item, index) => index != 0)
that.formData.product_id ?
productUpdate(that.mer_id, that.formData.product_id, data)
.then(res => {
Modal('提交成功', '点击确定,前往商品列表页面').then(() => {
if (this.import == 1) {
uni.$emit('importAttrValueOK', this.setFormData.import_id);
uni.navigateBack();
} else {
uni.redirectTo({
url: `/pages/product/list/index?mer_id=${that.mer_id}&type=6`
})
}
}).catch(() => {
uni.navigateBack()
})
})
.catch(rej => {
// Toast(rej);
}) :
productCreate(that.mer_id, data)
.then(res => {
Modal('提交成功', '点击确定,前往商品列表页面').then(() => {
if (this.import == 1) {
uni.$emit('importAttrValueOK', this.setFormData.import_id);
uni.redirectTo({
url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6`
})
} else {
uni.redirectTo({
url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6`
})
}
}).catch(() => {
uni.redirectTo({
url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6`
})
})
})
.catch(rej => {
// Toast(rej);
})
},
submit() {
// console.log(this.formData)
this.$refs.formData.validate().then(res => {
this.handAdd()
}).catch(errors => {
// console.log(errors)
uni.$u.toast(errors[0].message)
})
},
oldToNew(formData) {
if (formData.attr.length <= 1) return
formData.attr.splice(1, 999)
formData.attr[0].value = ' '
formData.attr[0].detail = formData.attrValue.map(item => item.sku)
formData.attrValue.forEach((item, index) => {
item.detail = {}
item.detail[' '] = formData.attr[0].detail[index]
})
this.formData = formData
},
initFormData(option) {
this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2;
this.mer_id = option.mer_id
if (option.formData) {
this.formData = JSON.parse(option.formData)
}
if (option.goodsInfo) {
let goods = JSON.parse(option.goodsInfo)
console.log(goods)
this.formData.store_name = goods.store_name
this.formData.imageList = [goods.image, ...goods.slider_image]
console.log(this.formData)
}
}
},
onLoad(option) {
// let that = this
this.initFormData(option)
this.showSet = option.showSet ? JSON.parse(option.showSet) : this.showSet
this.isSet2()
this.formData.delivery_way = this.$store.state.app.userInfo?.mer_info.delivery_way.split(',')
if (option.product_id) {
this.formData.product_id = option.product_id
this.mode = 'edit'
this.showSet = true
productDetail(option.mer_id, option.product_id).then(res => {
Object.assign(this.formData, res.data)
this.$set(this.formData, "imageList", res.data.image_list)
this.formData.product_attribute = JSON.parse(this.formData.product_attribute)
this.formData.cate_name = this.formData.storeCategory.cate_name
this.formData.cate_id = this.formData.storeCategory.store_category_id
delete this.formData.image_list
if (!this.formData.imageList) this.formData.imageList = []
this.oldToNew(this.formData)
console.log(this.formData, 'formDATA')
})
}
},
onBackPress: function(e) {
this.showlay = true
return this.go;
}
};
</script>
<style lang='scss'>
.content {
width: 100vw;
min-height: 100vh;
background-color: #F1F1F1;
box-sizing: border-box;
padding-bottom: 280rpx;
padding: 20rpx 20rpx 200rpx 20rpx;
.card {
background-color: white;
padding: 28rpx 30rpx;
border-radius: 12rpx;
margin-bottom: 30rpx;
}
.uploadimg {
width: 140rpx;
height: 140rpx;
border-radius: 16rpx;
border: 2rpx solid #F1F1F1;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
box-sizing: border-box;
padding: 20rpx 0;
overflow: hidden;
}
.tips {
color: #777777;
font-size: 28rpx;
margin: 30rpx 0;
}
.submit-btn {
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translate(-50%, 0);
width: 670rpx;
border-radius: 40rpx;
overflow: hidden;
}
}
.overlay-content {
width: 570rpx;
height: 640rpx;
box-sizing: border-box;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 16rpx;
background-image: url('/static/images/addGodd/addGoodBg.png');
background-size: 100% 100%;
background-repeat: no-repeat;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
padding: 70rpx 0 40rpx 0;
}
.jiao {
image {
position: absolute;
top: -14rpx;
right: -14rpx;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
padding: 8rpx;
z-index: 2;
}
video {
width: 140rpx;
height: 140rpx;
}
}
.preview_video {
position: absolute;
background-color: red;
}
.content_list_video {
min-height: 154rpx;
padding: 23rpx 10rpx;
display: flex;
justify-content: space-between;
.content_list_video_title {
/* padding-top: 10rpx; */
}
}
.video-count {
position: fixed;
width: 600rpx;
height: 500rpx;
top: 50%;
left: 50%;
margin-left: -300rpx;
margin-top: -250rpx;
z-index: 100;
display: flex;
align-items: center;
justify-content: center;
.videoLink {
width: 600rpx;
height: 500rpx;
}
}
.video-text {
color: red;
font-size: 24rpx;
text-align: center;
/* position: absolute; */
}
.image-play-icon {
background-color: rgba(0, 0, 0, 0.3);
width: 140rpx;
height: 140rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
align-items: center;
justify-content: space-around;
}
</style>

View File

@ -0,0 +1,512 @@
<template>
<view class="content">
<u--form :model="model1" ref="uForm" labelPosition="left" :labelStyle="{fontSize:'32rpx',color:'#444444'}"
labelWidth='120' borderBottom>
<view class="description">
产品属性
</view>
<view class="label-cls">
<u-form-item label="产地" prop="userInfo.name" ref="item1">
<view style="display: flex;align-items: center;font-size: 28rpx;color:#777777 ;" slot="right"
@click="showPouple=true,popType='place',getLocation()">
<view style="margin-right: 10rpx;line-height: 25rpx;">
{{formData.product_attribute.address||'请选择'}}
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item label="商品等级" prop="userInfo.name" ref="item1">
<view style="display: flex;align-items: center;font-size: 28rpx;color:#777777 ;" slot="right"
@click="showPouple=true,popType='leval'">
<view style="margin-right: 10rpx;line-height: 25rpx;">
{{formData.product_attribute.leval||'请选择'}}
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
<u-form-item label="货品包装" prop="userInfo.name" ref="item1">
<view style="display: flex;align-items: center;font-size: 28rpx;color:#777777 ;" slot="right"
@click="showPouple=true,popType='packing'">
<view style="margin-right: 10rpx;line-height: 25rpx;">{{formData.product_attribute.pack||'请选择'}}
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</u-form-item>
</view>
<view class="description" style="display: flex;justify-content: space-between;align-items: center">
<text>产品属性</text>
<view class="attr-custom" @click="formData.product_attribute.attr.push({label:'',value:''})">
<u-icon name="plus" color='#20B128' style="margin-right: 8rpx;font-weight: bold;"></u-icon> 自定义
</view>
</view>
<view class="label-cls"
style="display: flex;padding: 20rpx 20rpx 20rpx 2rpx;justify-content: space-between;margin-bottom: 30rpx;"
v-for="(item,index) in formData.product_attribute.attr">
<view class="" style="display: flex;width: 70%;align-items: center;">
<u--input placeholder="请填写属性名称" border="surround" v-model="item.label"></u--input>
<u-line direction="col" length="40rpx" color="#CECECE"></u-line>
<u--input placeholder="请填写属性值" border="surround" v-model="item.value"></u--input>
<u-line direction="col" length="40rpx" color="#CECECE"></u-line>
</view>
<view style="color: #777777;display: flex; align-items: center;"
@click="formData.product_attribute.attr.splice(index, 1);">
<u-icon name="trash" style='margin-right: 8rpx;'></u-icon> 删除
</view>
</view>
</u--form>
<view class="submit-btn">
<u-button type="primary" shape="circle" text="保存" @click="submit"></u-button>
</view>
<u-popup :show="showPouple" @close="showPouple=false,positionType=0" @open="showPouple=true" :round="10">
<view class="RegularFont" style="padding: 42rpx 40rpx">
<view class="pop-head">
<text v-if="popType=='place' || !show " @click="showPouple=false,positionType=0">取消</text>
<text v-else @click="show=false"><u-icon name="arrow-left" size="20"></u-icon></text>
<text
style="font-size:32rpx ;color:#333333 ;">{{popType=='place'?'商品产地': popType=='leval'?'商品等级':'商品包装' }}
</text>
<text @click="confirm">确定</text>
</view>
<!-- 地区 -->
<view v-if="popType=='place'">
<view class="Positioning " style="color: #989898;margin-bottom: 30rpx;">
<view class="" style="display: flex;" @click="confirm">
<u-icon name="map" style='margin-right: 8rpx;'></u-icon>
<text>{{(address.province+address.city+address.district )||errMag}} </text>
</view>
<view class="" @click="getLocation">
刷新定位
</view>
</view>
<u-line color="#CECECE"></u-line>
<view class="province">
<view class="province-li" @click='positionType=0,positionList=provinceList'
:style="{color:positionType==0?'#20B128':'#707070'} ">
{{address.province||'请选择' }}
</view>
<view class="province-li" @click='choseCity'
:style="{color:positionType==1?'#20B128':'#707070'} ">
{{address.city ||'请选择'}}
</view>
<view class="province-li" @click='choseArea'
:style="{color:positionType==2?'#20B128':'#707070'} ">
{{address.district ||'请选择'}}
</view>
<view class="province-line" :style="{left:positionType*130+30+'rpx'}" />
</view>
<u-line color="#CECECE"></u-line>
<view class="" style="color:#989898;font-size:24rpx ;margin-top: 40rpx;">
请选择
</view>
<view class="position-content">
<view class="position-li" :class="{act:address[wacthType()]==item.name}"
v-for="item in positionList" @click="chosePosition(item)">
<text>
{{item.name}}
</text>
<u-icon v-if='address[wacthType()]==item.name' name="checkbox-mark" color="#38BE41"
style='margin-left: 8rpx;'></u-icon>
</view>
</view>
</view>
<!-- 地区结束 -->
<!-- 商品等级 -->
<view v-if="popType=='leval'" style="height: 500rpx;">
<u-transition :show="!show" mode="slide-right">
<view class="goods-leval">
<view class="goods-leval-li" :class="{act:formData.product_attribute.leval==item}"
v-for='item in levalList'
@click="formData.product_attribute.leval=item,showPouple=false">
{{item}}
</view>
<view class="goods-leval-li " style="display: flex;color:#38BE41;" @click="show=true">
<u-icon name="plus" color="#38BE41" style='margin-right: 8rpx;'></u-icon> 自定义
</view>
</view>
</u-transition>
<u-transition :show="show" mode="slide-left">
<view class="transition">
<u--textarea v-model="selfLeval" placeholder="请输入商品等级"></u--textarea>
</view>
</u-transition>
</view>
<!-- 商品等级结束 -->
<!-- 商品包装 -->
<view v-if="popType=='packing'" style="height: 500rpx;">
<u-transition :show="!show" mode="slide-right">
<view class="goods-leval">
<view class="goods-leval-li" :class="{act:formData.pack==item}" v-for='item in packList'
@click="formData.product_attribute.pack=item,showPouple=false">
{{item}}
</view>
<view class="goods-leval-li " style="display: flex;color:#38BE41 ;" @click="show=true">
<u-icon name="plus" color="#38BE41" style='margin-right: 8rpx;'></u-icon> 自定义
</view>
</view>
</u-transition>
<u-transition :show="show" mode="slide-left">
<view class="transition">
<u--textarea v-model="selfPack" placeholder="请输入商品等级"></u--textarea>
</view>
</u-transition>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
getGeocoder,
} from '@/api/store.js';
import {
getProvince,
getCity,
getArea
} from "@/api/common.js"
import {
formatDate
} from '../../../libs/uniApi';
export default {
data() {
return {
errMag: "",
provinceList: [],
cityList: [],
districtList: [],
positionList: [],
areaList: [],
districtList: [],
posType: {
},
selfLeval: "",
levalList: [
"优等品",
"一等品",
"合格品",
],
selfPack: "",
packList: [
"盒装",
"箱装",
"袋装",
"盆装",
"泡沫箱"
],
address: {
province: '',
province_code: '',
city: "",
city_code: "",
district: "",
district_code: ""
},
show: false,
popType: 'leval',
showPouple: false,
showSex: false,
positionType: 0,
data: {},
formData: {
// address: "",
// leval: "",
// pack: "",
// attr: [{
// label: "",
// value: ''
// }]
},
model1: {
userInfo: {
name: '',
sex: '',
},
},
};
},
methods: {
sexSelect(e) {
this.model1.userInfo.sex = e.name
this.$refs.uForm.validateField('userInfo.sex')
},
navgo(url) {
uni.navigateTo({
url
})
},
confirm() {
if (this.popType == 'place') {
this.formData.product_attribute.address = this.address.province + this.address.city + this.address
.district
} else if (this.popType == 'leval') {
this.levalList.push(this.selfLeval)
this.formData.product_attribute.leval = this.levalList[this.levalList.length - 1]
this.selfLeval = ''
} else if (this.popType == 'packing') {
this.packList.push(this.selfPack)
this.formData.pack = this.packList[this.packList.length - 1]
this.selfPack = ''
}
this.show = false
this.showPouple = false
},
chosePosition(item) {
if (this.positionType == 0) {
this.address.province = item.name
this.address.province_code = item.code
this.address.city = ''
this.address.district = ''
} else if (this.positionType == 1) {
this.address.city = item.name
this.address.city_code = item.code
this.address.district = ''
console.log(this.address)
} else {
this.address.district = item.name
this.address.district_code = item.code
}
},
wacthType() {
if (this.positionType == 0) return "province";
else if (this.positionType == 1) return "city";
else if (this.positionType == 2) return "district";
},
choseCity() {
this.positionType = 1;
getCity({
code: this.address.province_code
}).then(res => {
this.cityList = res.data
this.positionList = this.cityList
this.cityList.forEach(item => {
if (this.address.city == item.name) {
this.address.city_code = item.code
}
})
})
},
choseArea() {
this.positionType = 2;
console.log(this.address)
getArea({
city_code: this.address.city_code
}).then(res => {
this.areaList = res.data
this.positionList = this.areaList
})
},
getLocation() {
let that = this
uni.getLocation({
type: 'wgs84',
success: function(res) {
console.log(res, 'res')
getGeocoder({
lat: res.latitude,
long: res.longitude
}).then(res1 => {
that.address = res1.data.address_component
that.positionList = that.provinceList
that.provinceList.forEach(item => {
if (that.address.province == item.name) {
that.address.province_code = item.code
}
})
}).catch(err => {
console.log("获取位置失败")
uni.showToast({
title: err,
icon: 'none'
})
})
},
fail: function(err) {
that.errMag = "获取位置失败,请手动先择"
console.log('sad', err)
}
});
},
submit() {
let that = this
uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }`
})
}
},
onLoad(option) {
getProvince().then(res => {
this.provinceList = res.data
this.positionList = res.data
})
this.formData = JSON.parse(option.formData)
if (option.mer_id) {
this.mer_id = option.mer_id
}
}
};
</script>
<style lang='scss'>
.MediumFont {}
.RegularFont {}
.content {
box-sizing: border-box;
padding: 30rpx;
background-color: #F1F1F1;
min-height: 100vh;
position: relative;
font-size: 28rpx;
}
.label-cls {
background-color: white;
padding: 8rpx 30rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
}
.description {
background-color: #F1F1F1;
padding: 30rpx 0rpx;
font-size: 28rpx;
color: #777777;
width: 690rpx;
}
.attr-custom {
display: flex;
align-items: center;
border: 1px solid #38BE41;
background-color: #E0EFE1;
border-radius: 36rpx 36rpx 36rpx 36rpx;
padding: 7rpx 10rpx;
color: #20B128;
}
.submit-btn {
position: fixed;
bottom: 50rpx;
width: 670rpx;
}
.pop-head {
display: flex;
justify-content: space-between;
color: #20B128;
margin-bottom: 42rpx;
}
.Positioning {
display: flex;
justify-content: space-between;
}
.province {
display: flex;
position: relative;
.province-li {
color: #707070;
font-size: 32rpx;
margin: 30rpx 40rpx 30rpx 0;
}
.province-line {
position: absolute;
height: 2px;
width: 40rpx;
background-color: #20B128;
bottom: 20rpx;
left: 30rpx;
transition: 500ms;
}
}
.position-content {
height: 600rpx;
overflow-y: auto;
.position-li {
font-size: 28rpx;
color: #707070;
margin-top: 30rpx;
display: flex;
align-items: center;
}
.act {
color: #20B128;
}
}
.goods-leval {
overflow-y: auto;
display: flex;
flex-wrap: wrap;
margin-bottom: 20rpx;
.goods-leval-li {
margin-right: 20rpx;
padding: 10rpx 40rpx;
height: 60rpx;
margin-bottom: 20rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-color: #F1F1F1;
}
.act {
color: #20B128;
background-color: #E8F7E9;
border: 1px solid #20B128;
}
}
/* .toast {
position: absolute;
color: white;
background-color: #20B128;
display: flex;
align-items: center;
padding: 20rpx;
} */
</style>

View File

@ -0,0 +1,392 @@
<template>
<view class="content">
<view class="">
<u-button icon="plus" text="新增规格" @click="pushFn" class="custom-style" iconColor='#38BE41'></u-button>
</view>
<view class="card" v-for="(item,index) in attrValue">
<view class="card-head card-li">
<text style="font-size: 32rpx;">规格{{index+1}}</text>
<view class="" style="width: 300rpx;">
<!-- {{formData.attr}} -->
<!-- <u--input placeholder="请输入规格名称" inputAlign='right' v-model="formData.attr[index].value"></u--input> -->
<u--input placeholder="请输入规格名称" inputAlign='right' v-model="item.sku"></u--input>
</view>
</view>
<u-line direction="row" style="margin: 30rpx 0;" color="#ECECEC"></u-line>
<view class="">
<view class="" style="display: flex;align-items: center;justify-content: space-between;">
<u--input style="flex: 2; background-color: #F6F6F6;" placeholder="请输入商品单价" v-model="item.price"
type='number'></u--input>
<view class="" style="flex: 1;text-align: center;">
/
</view>
<view class="" @click="unitIptClick(index,false)" style="width: 100rpx;flex: 2.4">
<u--input readonly style=" background-color: #F6F6F6;pointer-events: none;"
placeholder="请输入计量单位" v-model="item.unit_name"></u--input>
</view>
</view>
<view class="" v-if='isWholeSale'
style="display: flex;align-items: center;justify-content: space-between;margin-top: 30rpx;">
<u--input style="flex: 2; background-color: #F6F6F6;" placeholder="请输批发价格"
v-model="item.wholesale_price" type='number'></u--input>
<view class="" style="flex: 1;text-align: center;">
/
</view>
<view class="" @click="unitIptClick(index,true)" style="width: 100rpx;flex: 2.4">
<u--input style="background-color: #F6F6F6;pointer-events: none;" readonly placeholder="请输入计量单位"
v-model="item.wholesale_unit_name"></u--input>
</view>
</view>
</view>
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
<view class=" card-li">
<text style="font-size: 32rpx;">商品库存</text>
<view class="" style="width: 300rpx;">
<u--input type='number' placeholder="请填写库存数量" inputAlign='right' v-model="item.stock"></u--input>
</view>
</view>
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
<view class=" card-li">
<text style="font-size: 32rpx;">条形码</text>
<view class="" style="width: 300rpx;">
<u--input placeholder="请填写商品条形码" inputAlign='right' v-model="item.bar_code"
type='number'></u--input>
</view>
</view>
<u-line direction="row" style="margin: 25rpx 0;" color="#ECECEC"></u-line>
<view class="card-li">
<view style="display: flex;color: #777777;"
@click="attrValue.splice(index,1),formData.attr.splice(index,1)">
<u-icon name="trash" style='margin-right: 8rpx;'></u-icon> 删除
</view>
<view class="" style="display: flex;align-items: center;">
<u-switch v-model="item.is_use" type='primaryy' activeColor="#38BE41" size="19"></u-switch>
<text style="margin-left: 8rpx;color: #777777;">启用</text>
</view>
</view>
</view>
<view class="submit-btn">
<u-button type="primary" shape="circle" text="保存" @click="submit"></u-button>
</view>
<u-popup :show="showPouple" @close="showPouple=false" @open="showPouple=true" :round="10">
<view class="RegularFont" style="padding: 42rpx 40rpx">
<view class="pop-head">
<text v-if='!showCustom' @click='showPouple=false'>取消</text>
<text v-else @click='showCustom=false'>
<u-icon name="arrow-left" size="20"></u-icon>
</text>
<text style="font-size:32rpx ;color:#333333 ;">计量单位</text>
<text v-if='showCustom' @click='addAttr'>确定</text>
<text v-else></text>
</view>
<view style="height: 500rpx;">
<u-transition :show="!showCustom" mode="slide-right">
<view class="goods-leval">
<view class="goods-leval-li" v-for='(item,index) in attrList' :key='index'
@click='choseAttr(item)'>
{{item}}
</view>
<view class="goods-leval-li " style="display: flex;color:#38BE41 ;"
@click="showCustom=true">
<u-icon name="plus" color="#38BE41" style='margin-right: 8rpx;'></u-icon> 自定义
</view>
</view>
</u-transition>
<u-transition :show="showCustom" mode="slide-left">
<view class="transition">
<u--textarea v-model="selfAttr" placeholder="请输入计量单位"></u--textarea>
</view>
</u-transition>
</view>
</view>
</u-popup>
</view>
</template>
<script>
import {
formatDate
} from '../../../libs/uniApi'
export default {
data() {
return {
selfAttr: "",
attrList: ['斤',
"公斤",
"吨",
"升",
"个",
"台",
"瓶",
"桶",
"箱",
"袋",
"包",
"盒",
"件",
"罐"
],
showCustom: false, //
showPouple: false,
unitIndex: 0,
mer_id: "",
isWholeSale: "",
isWhose: false,
text: "",
value: "",
formData: {},
"attrValue": [{
detail: {
' ': '',
},
"price": "",
"unit_name": "",
"wholesale_unit_name": "",
"wholesale_price": '',
"cost": "",
"stock": "",
sku: '',
"ot_price": "",
"procure_price": "",
"bar_code": "",
"weight": "",
"extension_one": "",
"extension_two": "",
uuid: "",
volume: "",
"is_use": 0,
}],
rules: {
price: '单价不能为空',
unit_name: '计量单位不能为空',
wholesale_price: '批发价格不能为空',
wholesale_unit_name: '批发单位不能为空',
stock: '库存不能为空',
}
}
},
methods: {
choseAttr(name) {
this.isWhose ?
this.attrValue[this.unitIndex].wholesale_unit_name = name :
this.attrValue[this.unitIndex].unit_name = name;
this.showPouple = false
},
addAttr() {
if (!this.selfAttr) return;
this.attrList.push(this.selfAttr)
this.isWhose ?
this.attrValue[this.unitIndex].wholesale_unit_name = this.attrList[this.attrList.length - 1] :
this.attrValue[this.unitIndex].unit_name = this.attrList[this.attrList.length - 1];
// this.attrValue[this.unitIndex].unit_name = this.attrList[this.attrList.length - 1]
// this.attrValue[this.unitIndex].wholesale_unit_name = this.attrList[this.attrList.length - 1]
this.selfAttr = ''
this.showCustom = false
this.showPouple = false
},
// hide() {
// uni.hideKeyboard()
// },
unitIptClick(index, type) {
this.isWhose = type
this.unitIndex = index
this.showPouple = true
uni.hideKeyboard()
},
pushFn() {
this.attrValue.push({
detail: {
' ': '',
},
"price": "",
"unit_name": "",
"wholesale_unit_name": "",
"wholesale_price": '',
"cost": "",
"stock": "",
sku: '',
"ot_price": "",
"procure_price": "",
"bar_code": "",
"weight": "",
"extension_one": "",
"extension_two": "",
uuid: "",
volume: "",
"is_use": true,
})
// this.formData.attr.push({
// value: '',
// detail: [],
// })
},
submit() {
//
let errList = []
if (!this.isWholeSale) {
delete this.rules.wholesale_unit_name
delete this.rules.wholesale_price
}
this.attrValue.forEach(item => {
for (let key in this.rules) {
if (!item[key]) {
errList.push(this.rules[key])
}
}
if (this.attrValue.length > 1) {
if (!item['sku']) {
errList.push('规格名称不能为空')
}
}
})
if (errList.length > 0) {
console.log(errList)
uni.$u.toast(errList[0])
return
}
console.log(this.attrValue)
//
this.formData.attr[0].detail = []
this.attrValue.forEach(item => {
typeof(item.detail) == 'object' ?
item.detail[' '] = item.sku: (item.detail = {}, item.detail[' '] = item.sku)
console.log(this.formData.attr)
this.formData.attr[0].detail.push(item.sku)
})
this.formData.attrValue = this.attrValue
this.formData.attrValue.forEach(item => {
item.is_use = item.is_use ? '0' : '1'
})
let that = this
// this.formData.attrValue.forEach((item, index) => {
// item.detail. = this.formData.attr[index].value
// item.sku = this.formData.attr[index].value
// })
this.formData.spec_type = this.formData.attrValue.length > 1 ? '1' : '0'
uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${that.mer_id}&&formData=${JSON.stringify(that.formData) }&&showSet=${true}`
})
},
initFomrData(option) {
if (option.mer_id) {
this.mer_id = option.mer_id
}
if (option.formData) {
this.formData = JSON.parse(option.formData)
}
}
},
onLoad(option) {
this.isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale == 2;
this.initFomrData(option)
this.attrValue = this.formData.attrValue
this.attrValue.forEach(item => {
item.is_use = !Boolean(Number(item.is_use))
})
if (this.formData.attr.length == 0) {
this.formData.attr.push({
value: '',
detail: [],
})
}
console.log(this.formData)
}
}
</script>
<style lang='scss'>
.custom-style {
color: $uni-newTheme-color;
height: 104rpx;
}
.content {
box-sizing: border-box;
padding: 30rpx;
background-color: #F1F1F1;
min-height: 100vh;
position: relative;
font-size: 28rpx;
padding-bottom: 200rpx;
.card {
margin-top: 30rpx;
padding: 30rpx 46rpx;
background-color: white;
border-radius: 16rpx 16rpx 16rpx 16rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
position: relative;
.card-li {
display: flex;
justify-content: space-between;
align-items: center;
}
}
.card-head::after {
content: '';
position: absolute;
font-size: 32rpx;
left: 20rpx;
width: 8rpx;
height: 32rpx;
top: 50rpx;
background-color: #40AE36;
border-radius: 4rpx 4rpx 4rpx 4rpx;
}
.submit-btn {
position: fixed;
bottom: 50rpx;
width: 670rpx;
}
}
.pop-head {
display: flex;
justify-content: space-between;
color: #20B128;
margin-bottom: 42rpx;
}
.goods-leval {
display: flex;
flex-wrap: wrap;
overflow-y: auto;
.goods-leval-li {
margin-right: 20rpx;
padding: 10rpx 40rpx;
height: 60rpx;
margin-bottom: 20rpx;
border-radius: 36rpx 36rpx 36rpx 36rpx;
background-color: #F1F1F1;
}
.act {
color: #20B128;
background-color: #E8F7E9;
border: 1px solid #20B128;
}
}
</style>

View File

@ -0,0 +1,154 @@
<template>
<view class="content">
<view class="" style="padding: 30rpx;">
<u-search v-model="keyword" :showAction="true" actionText="搜索" :animation="true"
@change="hdChange"></u-search>
</view>
<view class="" v-if='!keyword' style="padding-left: 44rpx;">
<view style="margin: 60rpx 0 30rpx 14rpx;">
常用分类
</view>
<view class="types">
<view class="types-li" v-for="(item,index) in typeList" @click='hdChose(item)'>
{{item.label}}
</view>
</view>
<view style="margin: 60rpx 0 30rpx 14rpx;">
热门分类
</view>
<view class="types">
<view class="types-li" v-for="(item,index) in hotList" @click='hdChose(item)'>
{{item.label}}
</view>
</view>
</view>
<view class="" v-else style="margin: 10rpx 0 0 30rpx;">
<view class="" v-if='searchList.length'>
<view class="keyword-li" v-for='item in searchList' @click='hdChose(item)'>
{{item.label}}
<u-line direction="row" color="#ECECEC"></u-line>
</view>
</view>
<view v-else style="text-align: center;margin-top: 50rpx;">
暂无搜索结果,点击 <text @click="navgo" style='color:#35BC3E;text-decoration: underline;'>手动选择</text>
</view>
</view>
</view>
</template>
<script>
import {
categorySearch,
categoryHotcate,
categorySearchHistory,
} from '@/api/product.js'
export default {
data() {
return {
formData: {},
type: 'detail',
keyword: "",
mer_id: "",
searchList: [],
hotList: [],
typeList: []
}
},
methods: {
hdChange() {
console.log(this.searchList)
categorySearch(this.mer_id, {
keyword: this.keyword
}).then(res => {
this.searchList = res.data
})
},
navgo() {
uni.redirectTo({
url: `/pages/product/addGoodDetail/goodsType?mer_id=${this.mer_id}&&type=${this.type}&&formData=${JSON.stringify(this.formData)}`
})
},
hdChose(item) {
this.formData.cate_name = item.label.includes('--') ? item.label
.split('--')[1] : item.label;
this.formData.cate_id = item.value
categorySearchHistory(this.mer_id, this.$store.state.app.userInfo.uid, {
cate_id: item.value
})
uni.redirectTo({
url: `/pages/product/addGood/addGood?mer_id=${this.mer_id}&&formData=${JSON.stringify(this.formData)}`
})
},
initFormData(option) {
this.mer_id = option.mer_id
if (option.type) {
this.type = 'simple'
}
this.formData = JSON.parse(option.formData)
}
},
onLoad(option) {
this.initFormData(option)
categoryHotcate(
option.mer_id,
this.$store.state.app.userInfo.uid
).then(res => {
this.hotList = res.data.hot_cate.map(item => ({
label: item.cate_name,
value: item.store_category_id
}))
this.typeList = res.data.active_cate.map(item => ({
label: item.cate_name,
value: item.store_category_id
})
)
})
}
}
</script>
<style lang='scss'>
.MediumFont {}
.RegularFont {}
.content {
box-sizing: border-box;
background-color: #FFFFFF;
min-height: 100vh;
position: relative;
font-size: 28rpx;
.types {
display: flex;
flex-wrap: wrap;
.types-li {
background-color: #F6F6F6;
border-radius: 8rpx 8rpx 8rpx 8rpx;
padding: 16rpx 24rpx;
margin-bottom: 46rpx;
margin-right: 20rpx;
}
}
.keyword-li {
padding-right: 30rpx;
/* background-color: #F6F6F6; */
height: 100rpx;
line-height: 100rpx;
}
.keyword-li:active {
background-color: #F6F6F6;
}
}
</style>

View File

@ -0,0 +1,180 @@
<template>
<view class="">
<!-- <view class="" style="padding: 30rpx;font-size: 28rpx;color: #989898;font-family: PingFangRegular;">
<text>当前已选</text>
<text style="margin-left: 48rpx;color: #20B128;">生鲜--水果阿萨</text>
</view> -->
<view class="content">
<view class="lines" :style="{top:(actIndex*40)+16+'px'}" />
<view class="left">
<view class="left-li" v-for="(item,index) in leftList" :class="actIndex==index?'act-li':''"
@click="hdClick(index)">
{{item.label}}
</view>
</view>
<view class="">
<u-line direction="col" color="#ECECEC"></u-line>
</view>
<view class="right">
<u-search :showAction="true" v-model="keyword" actionText="搜索" :animation="true" @search='hdSearch'
@custom='hdSearch'> </u-search>
<view style="margin: 30rpx 0;font-size: 28rpx; color: #989898;">
可能在找
</view>
<view class="right-content">
<view class="right-content-li" v-for="(item,index) in rightList" @click="choseType(item)">
{{item.label}}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
formatDate
} from '../../../libs/uniApi';
import {
categoryList,
categorySearch
} from '@/api/product.js'
export default {
data() {
return {
type: 'detail',
mer_id: "",
keyword: "",
actIndex: 0,
leftList: [],
rightList: [],
formData: {}
};
},
methods: {
hdClick(index) {
this.actIndex = index
this.rightList = this.leftList[index].children
},
choseType(item) {
this.formData.cate_name = item.label.includes('--') ? item.label
.split('--')[1] : item.label;
this.formData.cate_id = item.value
if (this.type == 'detail') {
uni.redirectTo({
url: `/pages/product/addGoodDetail/addGoodDetail?mer_id=${this.mer_id}&&formData=${JSON.stringify(this.formData)} `
})
} else {
uni.redirectTo({
url: `/pages/product/addGood/addGood?mer_id=${this.mer_id}&&formData=${JSON.stringify(this.formData)}`
})
}
},
hdSearch() {
categorySearch(this.mer_id, {
keyword: this.keyword
}).then(res => {
this.rightList = res.data
})
},
initFormData(option) {
this.mer_id = option.mer_id
if (option.type) {
this.type = 'simple'
}
this.formData = JSON.parse(option.formData)
}
},
onLoad(option) {
this.initFormData(option)
categoryList(option.mer_id).then((res) => {
this.leftList = res.data
this.rightList = res.data[0].children
}).catch(e => {
console.log(e);
})
}
};
</script>
<style lang='scss'>
.content {
display: flex;
box-sizing: border-box;
padding: 15px;
background-color: white;
min-height: 100vh;
position: relative;
.lines {
height: 16px;
border-radius: 5px;
width: 3px;
background-color: #40AE36;
position: absolute;
left: 20rpx;
transition: 200ms;
top: 33rpx;
}
.left {
margin-right: 30rpx;
width: 140rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.left-li {
text-align: center;
font-size: 32rpx;
color: #444444;
height: 40px;
/* border-top: 1px solid red; */
}
.act-li {
color: $uni-newTheme-color;
}
}
.right {
padding: 0 20rpx;
position: fixed;
width: 530rpx;
left: 220rpx;
min-height: 100vh;
overflow-y: auto;
.right-content {
display: flex;
/* justify-content: space-around; */
flex-wrap: wrap;
.right-content-li {
margin-right: 20rpx;
color: #444444;
font-size: 28rpx;
border-radius: 16rpx 16rpx 16rpx 16rpx;
border: 2rpx solid #989898;
padding: 16rpx 24rpx;
margin-bottom: 20rpx;
}
}
}
}
</style>

View File

@ -0,0 +1,33 @@
<template>
<view class="">
<u-overlay :show="showOverly||(where.type==2&&flag)||(where.type==3&&flag1)">
<view class="warp">
<view class="" style='font-size: 32rpx;'>
温馨提示
</view>
<view class="">
当前商品待审核删除后将移至回收站
</view>
<view class="warp-foot">
<view class="warp-foot-li">
<u-button text="返回" @click="showOverly = false"></u-button>
</view>
<view class="warp-foot-li">
<u-button type='primary' text="删除" @tap="handleRecycle(xjItem,where.type)"></u-button>
<u-button type='primary' text="我知道了" @tap="Iknow"></u-button>
<u-button type='primary' v-else text="继续下架" @tap="handleShelves(xjItem,0)"></u-button>
</view>
</view>
</view>
</u-overlay>
</view>
</template>
<script>
export default {
}
</script>
<style>
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,173 @@
<template>
<view class="" style="width: 750rpx;height: 100%;">
<view class="jump" @click="next">
<text class="font">跳过 </text>
</view>
<view class="target" :style="{left:left+'px',top:top+'px'}" v-if="top">
<text style="color:white;text-align: center;font-size: 32rpx;line-height: 32px;">发布商品</text>
</view>
<view class="next-btn" :style="{top:(bottomBtn-100) +'px'}">
<text class="next-btn-text font" @click="next">我知道了</text>
</view>
<view class="" :style="{left:(left+10)+'px',top:bottomBtn+50+'px'}">
<image src="/static/images/pointer.png" style="width: 254rpx;height: 254rpx;" mode=""></image>
</view>
<view class="tips" :style="{ left:(left-100)+'px',top:(top-260)+'px'}">
<view class="tras" :class="{act:isActive}">
<text class="font" style="line-height: 106rpx;">点击发布商品,开启赚钱之旅</text>
</view>
</view>
<view style="position: absolute;" :style="{left:left+50+'px',top:(top-50)+'px'}">
<image src="/static/images/greenLine.png" style="width:35px;height: 60px;" mode=""></image>
</view>
</view>
</template>
<script>
import {
isNewMer
} from '@/api/user.js';
export default {
data() {
return {
isActive: false,
left: -100,
top: 0,
subNVue: null,
bottomBtn: -100,
screenHeight: 672,
}
},
methods: {
jump() {
this.subNVue.hide('zoom-in', 300, )
},
test() {
this.subNVue.hide()
},
next() {
this.subNVue.hide('zoom-in', 300, )
isNewMer(this.$store.state.app.userInfo.uid, this.$store.state.app.userInfo.service?.mer_id, {
done: 1
}).then(res => {
console.log('res', res)
})
}
},
onLoad() {
let that = this
this.subNVue = uni.getSubNVueById('concatpro')
uni.$on('diverProductEmit', (data) => {
that.left = data.left
const res = uni.getSystemInfo({
success: (res => {
that.bottomBtn = res.screenHeight - 150
this.screenHeight = res.screenHeight
that.top = res.screenHeight - 55
// console.log('screenheight', this.screenHeight)
})
});
}),
setTimeout(() => {
that.isActive = true
}, 1000)
}
}
</script>
<style>
/* 定义动画效果 */
.target {
position: relative;
font-size: 32rpx;
border-radius: 40rpx;
height: 72rpx;
background-color: #32BB3B;
width: 302rpx;
}
.tips {
width: 462rpx;
height: 106rpx;
background-color: #5BE157;
border-radius: 20rpx;
padding-left: 20rpx;
}
.imgs {
width: 62px;
height: 62px;
position: absolute;
left: 40px;
top: 40px;
transform: translate(-50%, -50%);
}
.tras {
width: 0;
transition-property: width;
transition-duration: 3s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.act {
width: 500rpx;
}
.font {
font-size: 28rpx;
color: white;
lines: 1;
}
.bgimg {
width: 200rpx;
position: absolute;
z-index: 1;
}
.img {
opacity: 0;
width: 50rpx;
height: 50rpx;
transition-property: opacity;
transition-duration: 1s;
transition-delay: 0.1s;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.next-btn {
position: absolute;
left: 375rpx;
transform: translateX(-50%);
width: 240rpx;
height: 76rpx;
border: 1px solid white;
border-radius: 38rpx;
background: rgba(255, 255, 255, 0.4);
}
.next-btn-text {
line-height: 76rpx;
text-align: center;
}
.jump {
position: absolute;
right: 30rpx;
top: 80rpx;
border: 1px solid white;
padding: 10rpx 20rpx;
border-radius: 30rpx;
}
</style>

View File

@ -1,6 +1,46 @@
<template>
<view class="content">
<view class="head">
<view class="" style="width: 210rpx;height: 210rpx;position: relative;">
<!-- <u--image :src="short.image" width='210rpx' height='210rpx' duration="450"></u--image> -->
<image :src="short.image" style="width: 210rpx;height: 210rpx;" mode=""></image>
<view class="preview" @click="preViewImg(short.image)">
点击预览
</view>
</view>
<view class="right">
<view class="">
<view class="table">
<view class="" style="font-size: 32rpx;color: #444444;">
{{short.store_name}}
</view>
<view class="" style="font-size: 24rpx;color: #989898;margin-top: 10rpx;">
<!-- 库存 {{short.attrValue[0].stock}} -->
库存 {{attrvalueStock}}
</view>
</view>
<view class="" style="color: #FC452F;font-size: 24rpx;">
<text style="font-size: 22rpx;"></text><text>10.00</text><text style="color: #828282;">/</text>
</view>
</view>
</view>
<view class="attr" v-for="(item,index) in short.attrValue" :key="index">
<view class="attr-tit">
{{item.sku||'单规格'}}
</view>
<u-line color="#CECECE" style="margin: 30rpx 0 28rpx 0"></u-line>
<view class="" style="display: flex;justify-content: space-between;font-size: 32rpx;">
<view class="">
商品库存
</view>
<view class="" style="display: flex;align-items: center;color: #FC452F;">
<u--input border="surround" color='#FC452F' inputAlign='right' style='padding: 0;'
v-model="item.stock"></u--input>
</view>
</view>
</view>
<!-- <view class="table">
<u-sticky custom-nav-height="0" bgColor="#fff">
<view class="line th">
<view class="td img">图片</view>
@ -22,12 +62,16 @@
<input type="number" v-model="item.stock" />
</view>
</view>
</view>
</view> -->
<view style="height: 150rpx;"></view>
<view class="btn-view">
<!-- <view class="btn-view">f
<button class="btn" @click="show=true">确认修改</button>
</view> -->
<view class="submit-btn">
<u-button type="primary" shape="circle" text="确认修改" @click="show=true"></u-button>
</view>
<u-modal :show="show" :closeOnClickOverlay="true" title="提示" content="确定更新库存吗" showCancelButton @confirm="onUpdate" @cancel="show=false"></u-modal>
<u-modal :show="show" :closeOnClickOverlay="true" title="提示" content="确定更新库存吗" showCancelButton
@confirm="onUpdate" @cancel="show=false"></u-modal>
</view>
</template>
@ -39,16 +83,21 @@
productDetail,
productUpdateFree
} from "@/api/product.js"
import { Toast } from '../../../libs/uniApi';
import {
Toast
} from '../../../libs/uniApi';
export default {
data() {
return {
test: '20',
show: false,
defualtImg: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/uploads/20230130/00ebcfdf75684f5494c0193075055d1.png',
mer_id: '',
type: "",
short: {
product_id: ''
}
},
attrvalueStock: 0,
}
},
onLoad(options) {
@ -60,10 +109,29 @@ import { Toast } from '../../../libs/uniApi';
},
onShow() {},
methods: {
preViewImg(url) {
let that = this
uni.previewImage({
urls: [url],
// longPressActions: {
// itemList: ['', '', ''],
// success: function(data) {
// console.log('' + (data.tapIndex + 1) + ',' + (data.index + 1) + '');
// },
// fail: function(err) {
// console.log(err.errMsg);
// }
// }
});
},
initInfo() {
productDetail(this.mer_id, this.short.product_id).then((res) => {
this.short = res.data;
console.log({...res.data});
this.attrvalueStock = res.data.attrValue[0].stock
console.log({
...res.data
});
})
},
onUpdate() {
@ -79,19 +147,25 @@ import { Toast } from '../../../libs/uniApi';
this.show = false;
this.$nextTick(() => {
Toast('更新成功');
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
uni.navigateBack({
success:()=> {
let stock = 0;
this.short.attrValue.forEach(item=>{
stock = stock + parseInt(item.stock);
})
uni.$emit('updateStock', {
product_id: this.short.product_id,
stock: stock
})
}
})
// uni.redirectTo({
// url: `/pages/product/list/index?mer_id=${this.mer_id}&type=6`
// })
// uni.navigateBack({
// success: () => {
// let stock = 0;
// this.short.attrValue.forEach(item => {
// stock = stock + parseInt(item.stock);
// })
// uni.$emit('updateStock', {
// product_id: this.short.product_id,
// stock: stock
// })
// }
// })
}).catch(err => {
this.show = false;
this.$util.Tips({
@ -107,19 +181,92 @@ import { Toast } from '../../../libs/uniApi';
</script>
<style lang="scss">
.content {
padding: 20rpx 16rpx;
background-color: #F1F1F1;
min-height: 100vh;
.head {
background-color: #fff;
display: flex;
padding: 20rpx;
border-radius: 16rpx;
.right {
margin-left: 20rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
}
.attr {
width: 690rpx;
margin: 22rpx auto;
box-sizing: border-box;
background-color: white;
padding: 30rpx;
border-radius: 16rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
.attr-tit {
margin-left: 16rpx;
font-size: 32rpx;
position: relative;
}
.attr-tit::after {
content: '';
position: absolute;
width: 8rpx;
height: 32rpx;
background-color: #40AE36;
border-radius: 4rpx;
left: -16rpx;
top: 10rpx;
}
}
}
.preview {
width: 210rpx;
height: 50rpx;
position: absolute;
bottom: 0;
background: rgba(0, 0, 0, 0.2);
color: white;
text-align: center;
font-size: 24rpx;
line-height: 50rpx;
}
.submit-btn {
position: fixed;
bottom: 50rpx;
width: 670rpx;
}
// old
.table {
background-color: #fff;
border-top: 1rpx solid rgba(0, 0, 0, 0.1);
border-left: 1rpx solid rgba(0, 0, 0, 0.1);
border-right: 1rpx solid rgba(0, 0, 0, 0.1);
font-size: 28rpx;
.line {
display: flex;
border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
.img {
// width:140rpx;
width: 200rpx;
}
.sku {
flex: 1;
border-left: 1rpx solid rgba(0, 0, 0, 0.1);
@ -128,8 +275,10 @@ import { Toast } from '../../../libs/uniApi';
flex-direction: column;
align-items: center;
}
.stock {
width: 200rpx;
input {
width: 100%;
height: 100%;
@ -138,6 +287,7 @@ import { Toast } from '../../../libs/uniApi';
}
}
}
.th {
height: 70rpx;
line-height: 70rpx;
@ -145,24 +295,29 @@ import { Toast } from '../../../libs/uniApi';
font-size: 32rpx;
font-weight: bold;
}
.tr {
min-height: 140rpx;
.td {
display: flex;
justify-content: center;
align-items: center;
}
.img {
image {
width: 120rpx;
height: 120rpx;
}
}
.sku {
padding: 16rpx 16rpx;
}
}
}
.btn-view {
position: fixed;
bottom: 0;

27
pages/test/index.vue Normal file
View File

@ -0,0 +1,27 @@
<template>
<view class="" style="width: 750rpx;height: 100vh;background-color: pink;">
我已经吐了傻逼是的
<button @click="tests">anniu1</button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
tests() {
const subNVue = uni.getSubNVueById('concat')
subNVue.show('slide-in-left', 200, () => {
console.log('subNVue 原生子窗体显示成功');
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<view class="" style="padding: 200rpx;background-color: red; width: 500rpx;height: 500rpx;">
<image src="/static/images/f.png" alt="" />
</view>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -1,21 +1,86 @@
@charset "UTF-8";
* {scrollbar-color: #e5e5e5 #f7f7f9;scrollbar-width: thin;}
html {margin: 0 auto;max-width: 1200px;}
body {overflow-x: hidden;}
.font-color,.font-color-red {color:#fc4141!important}
.bg-color{background-color:#e93323!important}
.icon-color{color: #ff3c2b}
.cart-color {color: #ff3700 !important;border:1px solid #ff3700 !important}
.padding20{padding: 20rpx}
.pad20 {padding: 0 20rpx}
.padding30{padding: 30rpx}
.pad30{padding: 0 30rpx}
.pull-left{float: left;}
.pull-right{float: right;}
.clearfix:after{content:'';display:block;height:0;clear:both}
.clearfix{zoom:1}
.acea-row {display:-webkit-box;display:-moz-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-lines: multiple;
-moz-box-lines:multiple;-o-box-lines:multiple;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}
* {
scrollbar-color: #e5e5e5 #f7f7f9;
scrollbar-width: thin;
}
html {
margin: 0 auto;
max-width: 1200px;
}
body {
overflow-x: hidden;
}
.font-color,
.font-color-red {
color: #fc4141 !important
}
.bg-color {
background-color: #e93323 !important
}
.icon-color {
color: #ff3c2b
}
.cart-color {
color: #ff3700 !important;
border: 1px solid #ff3700 !important
}
.padding20 {
padding: 20rpx
}
.pad20 {
padding: 0 20rpx
}
.padding30 {
padding: 30rpx
}
.pad30 {
padding: 0 30rpx
}
.pull-left {
float: left;
}
.pull-right {
float: right;
}
.clearfix:after {
content: '';
display: block;
height: 0;
clear: both
}
.clearfix {
zoom: 1
}
.acea-row {
display: -webkit-box;
display: -moz-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-lines: multiple;
-moz-box-lines: multiple;
-o-box-lines: multiple;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap
}
.acea-row.row-middle {
-webkit-box-align: center;
-moz-box-align: center;
@ -24,6 +89,7 @@ body {overflow-x: hidden;}
-webkit-align-items: center;
align-items: center
}
.acea-row.row-top {
-webkit-box-align: start;
-moz-box-align: start;
@ -32,6 +98,7 @@ body {overflow-x: hidden;}
-webkit-align-items: flex-start;
align-items: flex-start
}
.acea-row.row-bottom {
-webkit-box-align: end;
-moz-box-align: end;
@ -40,6 +107,7 @@ body {overflow-x: hidden;}
-webkit-align-items: flex-end;
align-items: flex-end
}
.acea-row.row-center {
-webkit-box-pack: center;
-moz-box-pack: center;
@ -48,6 +116,7 @@ body {overflow-x: hidden;}
-webkit-justify-content: center;
justify-content: center
}
.acea-row.row-right {
-webkit-box-pack: end;
-moz-box-pack: end;
@ -56,6 +125,7 @@ body {overflow-x: hidden;}
-webkit-justify-content: flex-end;
justify-content: flex-end;
}
.acea-row.row-left {
-webkit-box-pack: start;
-moz-box-pack: start;
@ -64,6 +134,7 @@ body {overflow-x: hidden;}
-webkit-justify-content: flex-start;
justify-content: flex-start
}
.acea-row.row-between {
-webkit-box-pack: justify;
-moz-box-pack: justify;
@ -72,10 +143,12 @@ body {overflow-x: hidden;}
-webkit-justify-content: space-between;
justify-content: space-between
}
.acea-row.row-around {
justify-content: space-around;
-webkit-justify-content: space-around
}
.acea-row.row-column-around {
-webkit-flex-direction: column;
-ms-flex-direction: column;
@ -83,6 +156,7 @@ body {overflow-x: hidden;}
justify-content: space-around;
-webkit-justify-content: space-around
}
.acea-row.row-column {
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
@ -91,6 +165,7 @@ body {overflow-x: hidden;}
-ms-flex-direction: column;
flex-direction: column
}
.acea-row.row-column-between {
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
@ -105,6 +180,7 @@ body {overflow-x: hidden;}
-webkit-justify-content: space-between;
justify-content: space-between
}
.acea-row.row-center-wrapper {
-webkit-box-align: center;
-moz-box-align: center;
@ -119,6 +195,7 @@ body {overflow-x: hidden;}
-webkit-justify-content: center;
justify-content: center
}
.acea-row.row-between-wrapper {
-webkit-box-align: center;
-moz-box-align: center;
@ -133,6 +210,7 @@ body {overflow-x: hidden;}
-webkit-justify-content: space-between;
justify-content: space-between
}
.start {
width: 122rpx;
height: 30rpx;
@ -140,49 +218,172 @@ body {overflow-x: hidden;}
background-repeat: no-repeat;
background-size: 122rpx auto;
}
.start.star5{background-position:0 3rpx;}
.start.star4{background-position:0 -30rpx;}
.start.star3{background-position:0 -70rpx;}
.start.star2{background-position:0 -105rpx;}
.start.star1{background-position:0 -140rpx;}
.start.star0{background-position:0 -175rpx;}
*{box-sizing:border-box}
page{font-size: 28rpx;background-color:#f5f5f5;color: #333}
body,html{height:unset}
button{padding:0;margin:0;line-height:normal;background-color:#fff}
button::after {border:0}
radio .wx-radio-input {border-radius:50%;width:38rpx;height:38rpx}
radio .wx-radio-input.wx-radio-input-checked{border:1px solid #e93323;background-color:#e93323;}
radio .uni-radio-input{border-radius:50%;width:38rpx;height:38rpx}
radio .uni-radio-input.uni-radio-input-checked{border: 1px solid #e93323;background-color: #e93323;}
checkbox .wx-checkbox-input{width:38rpx;height:38rpx}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before{color: #fff!important;}
checkbox .uni-checkbox-input{width: 38rpx;height: 38rpx}
.start.star5 {
background-position: 0 3rpx;
}
.start.star4 {
background-position: 0 -30rpx;
}
.start.star3 {
background-position: 0 -70rpx;
}
.start.star2 {
background-position: 0 -105rpx;
}
.start.star1 {
background-position: 0 -140rpx;
}
.start.star0 {
background-position: 0 -175rpx;
}
* {
box-sizing: border-box
}
page {
font-size: 28rpx;
background-color: #f5f5f5;
color: #333
}
body,
html {
height: unset
}
button {
padding: 0;
margin: 0;
line-height: normal;
background-color: #fff
}
button::after {
border: 0
}
radio .wx-radio-input {
border-radius: 50%;
width: 38rpx;
height: 38rpx
}
radio .wx-radio-input.wx-radio-input-checked {
border: 1px solid #e93323;
background-color: #e93323;
}
radio .uni-radio-input {
border-radius: 50%;
width: 38rpx;
height: 38rpx
}
radio .uni-radio-input.uni-radio-input-checked {
border: 1px solid #e93323;
background-color: #e93323;
}
checkbox .wx-checkbox-input {
width: 38rpx;
height: 38rpx
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
color: #fff !important;
}
checkbox .uni-checkbox-input {
width: 38rpx;
height: 38rpx
}
checkbox .uni-checkbox-input.uni-checkbox-input-checked,
checkbox .wx-checkbox-input.wx-checkbox-input-checked{border:1px solid #e93323!important;background-color:#e93323!important;color:#fff!important;}
checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{font-size: 35rpx}
.line1{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.line2{word-break:break-all;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;}
.mask{position:fixed;top: 0;left:0;right:0;bottom:0;background-color:#000;opacity:.5;z-index:30}
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
border: 1px solid #e93323 !important;
background-color: #e93323 !important;
color: #fff !important;
}
checkbox .uni-checkbox-input.uni-checkbox-input-checked::before {
font-size: 35rpx
}
.line1 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
.line2 {
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
white-space: pre-wrap;
}
.mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #000;
opacity: .5;
z-index: 30
}
@keyframes load {
from {
transform: rotate(0)
}
to {
transform: rotate(360deg)
}
}
@-webkit-keyframes load {
from {
transform: rotate(0)
}
to {
transform: rotate(360deg)
}
}
.loadingpic{animation:load 3s linear 1s infinite;--webkit-animation:load 3s linear 1s infinite}
.loading-list{animation:load linear 1s infinite;-webkit-animation:load linear 1s infinite;font-size:40rpx;margin-right:22rpx}
.loading{width:100%;height:100rpx;line-height:100rpx;align-items:center;justify-content:center;position:relative;text-align:center}
.loadingpic {
animation: load 3s linear 1s infinite;
--webkit-animation: load 3s linear 1s infinite
}
.loading-list {
animation: load linear 1s infinite;
-webkit-animation: load linear 1s infinite;
font-size: 40rpx;
margin-right: 22rpx
}
.loading {
width: 100%;
height: 100rpx;
line-height: 100rpx;
align-items: center;
justify-content: center;
position: relative;
text-align: center
}
.loading .line {
position: absolute;
width: 450rpx;
@ -191,6 +392,7 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{font-size: 35rpx
height: 1px;
border-top: 1px solid #eee
}
.loading .text {
position: relative;
display: inline-block;
@ -199,11 +401,13 @@ checkbox .uni-checkbox-input.uni-checkbox-input-checked::before{font-size: 35rpx
z-index: 2;
color: #777
}
.loadingicon .loading {
animation: load linear 1s infinite;
font-size: 45rpx;
color: #000
}
.loadingicon {
width: 100%;
height: 80rpx;

44
static/css/theme.scss Normal file
View File

@ -0,0 +1,44 @@
// 此文件为uView的主题变量这些变量目前只能通过uni.scss引入才有效另外由于
// uni.scss中引入的样式会同时混入到全局样式文件和单独每一个页面的样式中造成微信程序包太大
// 故uni.scss只建议放scss变量名相关样式其他的样式可以通过main.js或者App.vue引入
$u-main-color: #303133;
$u-content-color: #606266;
$u-tips-color: #909193;
$u-light-color: #c0c4cc;
$u-border-color: #dadbde;
$u-bg-color: #f3f4f6;
$u-disabled-color: #c8c9cc;
$u-primary: #32BB3B;
$u-primary-dark: #398ade;
$u-primary-disabled: #9acafc;
$u-primary-light: #ecf5ff;
$u-warning: #f9ae3d;
$u-warning-dark: #f1a532;
$u-warning-disabled: #f9d39b;
$u-warning-light: #fdf6ec;
$u-success: #5ac725;
$u-success-dark: #53c21d;
$u-success-disabled: #a9e08f;
$u-success-light: #f5fff0;
$u-error: #f56c6c;
$u-error-dark: #e45656;
$u-error-disabled: #f7b2b2;
$u-error-light: #fef0f0;
$u-info: #909399;
$u-info-dark: #767a82;
$u-info-disabled: #c4c6c9;
$u-info-light: #f4f4f5;
// scss混入为了少写几行#ifndef
@mixin flex($direction: row) {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: $direction;
}

BIN
static/empty/goodsEmpty.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

BIN
static/images/gban.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
static/images/greenLine.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
static/images/pointer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -11,9 +11,10 @@
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
@import '@/uni_modules/uview-ui/theme.scss';
@import '@/static/css/theme.scss';
/* 颜色变量 */
$uni-theme-color: #f45846;
$uni-newTheme-color: #38BE41;
$uni-theme-bg-color: linear-gradient(180deg, #f98649 0%, #f34e45 100%);
/* 行为相关颜色 */

View File

@ -20,9 +20,10 @@
<view class="uni-select__selector-empty" v-if="mixinDatacomResData.length === 0">
<text>{{emptyTips}}</text>
</view>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData" :key="index"
@click="change(item)">
<text :class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
<view v-else class="uni-select__selector-item" v-for="(item,index) in mixinDatacomResData"
:key="index" @click="change(item)">
<text
:class="{'uni-select__selector__disabled': item.disable}">{{formatItemName(item)}}</text>
</view>
</scroll-view>
</view>
@ -431,6 +432,7 @@
max-height: 600px;
}
}
/* #endif */
.uni-select__selector-empty,

View File

@ -1,51 +1,23 @@
<template>
<u-popup
:show="show"
@close="closeHandler"
>
<u-popup :show="show" @close="closeHandler">
<view class="u-picker">
<u-toolbar
v-if="showToolbar"
:cancelColor="cancelColor"
:confirmColor="confirmColor"
:cancelText="cancelText"
:confirmText="confirmText"
:title="title"
@cancel="cancel"
@confirm="confirm"
></u-toolbar>
<picker-view
class="u-picker__view"
:indicatorStyle="`height: ${$u.addUnit(itemHeight)}`"
:value="innerIndex"
:immediateChange="immediateChange"
:style="{
<u-toolbar v-if="showToolbar" :cancelColor="cancelColor" :confirmColor="confirmColor"
:cancelText="cancelText" :confirmText="confirmText" :title="title" @cancel="cancel"
@confirm="confirm"></u-toolbar>
<picker-view class="u-picker__view" :indicatorStyle="`height: ${$u.addUnit(itemHeight)}`"
:value="innerIndex" :immediateChange="immediateChange" :style="{
height: `${$u.addUnit(visibleItemCount * itemHeight)}`
}"
@change="changeHandler"
>
<picker-view-column
v-for="(item, index) in innerColumns"
:key="index"
class="u-picker__view__column"
>
<text
v-if="$u.test.array(item)"
class="u-picker__view__column__item u-line-1"
v-for="(item1, index1) in item"
:key="index1"
:style="{
}" @change="changeHandler">
<picker-view-column v-for="(item, index) in innerColumns" :key="index" class="u-picker__view__column">
<text v-if="$u.test.array(item)" class="u-picker__view__column__item u-line-1"
v-for="(item1, index1) in item" :key="index1" :style="{
height: $u.addUnit(itemHeight),
lineHeight: $u.addUnit(itemHeight),
fontWeight: index1 === innerIndex[index] ? 'bold' : 'normal'
}"
>{{ getItemText(item1) }}</text>
}">{{ getItemText(item1) }}</text>
</picker-view-column>
</picker-view>
<view
v-if="loading"
class="u-picker--loading"
>
<view v-if="loading" class="u-picker--loading">
<u-loading-icon mode="circle"></u-loading-icon>
</view>
</view>

View File

@ -10,7 +10,7 @@ $u-border-color: #dadbde;
$u-bg-color: #f3f4f6;
$u-disabled-color: #c8c9cc;
$u-primary: #3c9cff;
$u-primary: #32BB3B;
$u-primary-dark: #398ade;
$u-primary-disabled: #9acafc;
$u-primary-light: #ecf5ff;

View File

@ -604,7 +604,6 @@ export default {
is_load = opt.is_load || true,
uploadUrl = opt.url || '',
inputName = opt.name || 'field';
uni.chooseImage({
count: count, //最多可以选择的图片总数
sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有
@ -657,6 +656,83 @@ export default {
}
})
},
/*
* 多上传
* @param object opt
* @param callable successCallback 成功执行方法 data
* @param callable errorCallback 失败执行方法
*/
uploadImages: function(opt, successCallback, errorCallback) {
let that = this;
let obj = {};
if (typeof opt === 'string') {
let url = opt;
opt = {};
opt.url = url;
} else {
opt.crop ? obj.crop = opt.crop : null;
}
let count = opt.count || 1,
sizeType = opt.sizeType || ['compressed'],
sourceType = opt.sourceType || ['album', 'camera'],
is_load = opt.is_load || true,
uploadUrl = opt.url || '',
inputName = opt.name || 'field';
uni.chooseImage({
count: count, //最多可以选择的图片总数
sizeType: sizeType, // 可以指定是原图还是压缩图,默认二者都有
sourceType: sourceType, // 可以指定来源是相册还是相机,默认二者都有
...obj,
success: function(res) {
//启动上传等待中...
uni.showLoading({
title: '图片上传中',
});
res.tempFilePaths.forEach((item, index) => {
uni.uploadFile({
url: HTTP_REQUEST_URL + '/api/' + uploadUrl + '/' + inputName,
filePath: item,
name: inputName,
formData: {
'filename': inputName
},
header: {
// #ifdef MP
"Content-Type": "multipart/form-data",
// #endif
[TOKENNAME]: 'Bearer ' + store.state.app.token
},
success: function(res) {
uni.hideLoading();
if (res.statusCode == 403) {
that.Tips({
title: res.data
});
} else {
let data = res.data ? JSON.parse(res.data) : {};
if (data.status == 200) {
successCallback && successCallback(data)
} else {
errorCallback && errorCallback(data);
that.Tips({
title: data.message
});
}
}
},
fail: function(res) {
uni.hideLoading();
that.Tips({
title: '上传图片失败'
});
}
})
})
}
})
},
/**
* 小程序头像获取上传
* @param uploadUrl 上传接口地址