first commit
This commit is contained in:
1
金壶/appV1/pages/.pydio
Normal file
1
金壶/appV1/pages/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
df291915-f820-4fae-ae6a-b77b8570263f
|
||||
1
金壶/appV1/pages/auth/.pydio
Normal file
1
金壶/appV1/pages/auth/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
b523b2b8-8e69-4bcc-b9b4-b5bbb2e9932e
|
||||
264
金壶/appV1/pages/auth/baisc.vue
Normal file
264
金壶/appV1/pages/auth/baisc.vue
Normal file
@@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<view class="content w-100 h-100">
|
||||
<HeaderTop page_title='认证'></HeaderTop>
|
||||
<view class="progress bg-linear-gradient w-100">
|
||||
<uni-steps :options="[{title: '基本信息'}, {title: '资质图片'}, {title: '税务信息'}]" :active=list_index active-color='#FFFFFF'></uni-steps>
|
||||
</view>
|
||||
<view class="x-bg-white padding-30 font-weight">当前企业信息</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;"></view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
企业名称</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.name" placeholder="请输入企业名称"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
企业类型
|
||||
</view>
|
||||
<view class="uni-list-cell-db px-1 font-md flex-1">
|
||||
<picker @change="bindPickerChange" :value="index" :range="list" range-key="name">
|
||||
<view class="uni-input">{{list[index].name}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
联系人</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.linkman"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
手机号</view>
|
||||
<input class="px-1 font-md flex-1" type="number" maxlength="11" v-model="form.phone"/>
|
||||
</view>
|
||||
<pick-regions :defaultRegions="defaultRegions" @getRegions="handleGetRegions">
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
注册区域
|
||||
</view>
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
{{regionsName}}
|
||||
</view>
|
||||
</view>
|
||||
</pick-regions>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
详细地址</view>
|
||||
<input placeholder="(请输入营业执照上的详细地址)" class="px-1 font-md flex-1" type="text" v-model="form.detailPath" />
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
客服编号 (选填)</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.kefu"/>
|
||||
</view>
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 editBtn w-90" style="line-height: 80upx;" @click="next()">下一步</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pickRegions from '@/components/pick-regions/pick-regions.vue'
|
||||
import authentication from '../../utils/models/auth.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import commonPopup from "@/components/common/common-popup.vue"
|
||||
import shippingAddress from '../../utils/models/shop.js'
|
||||
import uniSteps from'../../components/uni-steps/uni-steps.vue'
|
||||
export default {
|
||||
components: {
|
||||
commonPopup,
|
||||
HeaderTop,
|
||||
pickRegions
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list_index:0,
|
||||
regions:[],
|
||||
defaultRegions:['安徽省','合肥市','蜀山区'],
|
||||
area_id: 2,
|
||||
list: [{
|
||||
key: '0',
|
||||
name: '请选择类型'
|
||||
},{
|
||||
key: 'purchasing_enterprise',
|
||||
name: '商业公司'
|
||||
},
|
||||
{
|
||||
key: 'purchasing_chain_boss',
|
||||
name: '连锁药房(总店)'
|
||||
},
|
||||
{
|
||||
key: 'liansuo_drugstore',
|
||||
name: '连锁药房(分店)'
|
||||
},
|
||||
{
|
||||
key: 'drugstore',
|
||||
name: '单体药房'
|
||||
},
|
||||
{
|
||||
key: 'clinic_single',
|
||||
name: '单体诊所'
|
||||
},
|
||||
{
|
||||
key: 'clinic_door',
|
||||
name: '门诊'
|
||||
},
|
||||
{
|
||||
key: 'clinic_community',
|
||||
name: '社区卫生服务所'
|
||||
},
|
||||
{
|
||||
key: 'hospital_private',
|
||||
name: '私立医院'
|
||||
}
|
||||
],
|
||||
index: 0,
|
||||
current: 0,
|
||||
form: {
|
||||
path: '', //地址
|
||||
name: "", //企业名称
|
||||
sub_type: 0, //企业类型
|
||||
detailPath: "", //详细地址
|
||||
linkman: "", //联系人姓名
|
||||
kefu: '' //客服
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bindPickerChange: function(e) {
|
||||
this.index = e.detail.value
|
||||
this.form.sub_type = this.list[this.index].key
|
||||
},
|
||||
before() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
// 下一步
|
||||
next() {
|
||||
this.do_auth()
|
||||
},
|
||||
async do_auth() {
|
||||
let parames = {
|
||||
name: this.form.name,
|
||||
area_id: this.area_id,
|
||||
sub_type: this.form.sub_type,
|
||||
business_address: this.form.detailPath,
|
||||
consignee: this.form.linkman,
|
||||
phone: this.form.phone,
|
||||
service_number: this.form.kefu,
|
||||
}
|
||||
if(parames.business_address==''){
|
||||
uni.showToast({
|
||||
title: '请填写详细地址',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
if(this.regionsName==''){
|
||||
uni.showToast({
|
||||
title: '请选择注册区域',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
let res = await authentication.authBaisc(parames);
|
||||
uni.navigateTo({
|
||||
url: '../auth/certificate'
|
||||
})
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
let data = await authentication.viewBaisc()
|
||||
|
||||
let info = data.data
|
||||
if (info.name) {
|
||||
this.form.name = info.name
|
||||
this.area_id = info.area_id
|
||||
this.form.sub_type = info.sub_type
|
||||
this.form.detailPath = info.business_address
|
||||
this.form.linkman = info.consignee
|
||||
this.form.phone = info.tel
|
||||
this.form.kefu = info.service_number
|
||||
if(info.area_name && info.area_name != 'undefined'){
|
||||
this.regions = info.area_name
|
||||
}
|
||||
for (let i in this.list) {
|
||||
if (this.form.sub_type == this.list[i]['key']) {
|
||||
this.index = i
|
||||
}
|
||||
}
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 获取选择的地区
|
||||
handleGetRegions(regions){
|
||||
this.regions = regions
|
||||
this.area_id = this.regions.map(item=>item.id).join('-')
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
regionsName(){
|
||||
// 转为字符串
|
||||
return this.regions.map(item=>item.area_name).join(' ')
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getInfo()
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.place {
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
|
||||
.b_header {
|
||||
|
||||
height: 148upx;
|
||||
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.progress{
|
||||
color:#FFFFFF;
|
||||
padding-top: 30px;
|
||||
height:200upx;
|
||||
|
||||
}
|
||||
</style>
|
||||
166
金壶/appV1/pages/auth/bank.vue
Normal file
166
金壶/appV1/pages/auth/bank.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<template>
|
||||
<view class="content w-100 h-100">
|
||||
<HeaderTop page_title='认证'></HeaderTop>
|
||||
<view class="progress bg-linear-gradient w-100">
|
||||
<uni-steps :options="[{title: '基本信息'}, {title: '资质图片'}, {title: '税务信息'}]" :active=list_index active-color='#FFFFFF'></uni-steps>
|
||||
</view>
|
||||
<view class="x-bg-white padding-30">税务信息</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
发票抬头</view>
|
||||
<input class="px-1 font-md flex-1" type="text"
|
||||
v-model="form.invoiceTitle"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
纳税人识别码</view>
|
||||
<input class="px-1 font-md flex-1" type="text"
|
||||
v-model="form.taxpayer"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
开户行</view>
|
||||
<input class="px-1 font-md flex-1" type="text"
|
||||
v-model="form.openingBank"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
<text class="mr-1 text-danger">*</text>
|
||||
对公账号</view>
|
||||
<input class="px-1 font-md flex-1" type="text"
|
||||
v-model="form.hedgeFund"/>
|
||||
</view>
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 editBtn w-90" style="line-height: 80upx;" @click="next()">提交</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import authentication from '../../utils/models/auth.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
export default {
|
||||
components: {
|
||||
HeaderTop
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list_index:2,
|
||||
form:{
|
||||
invoiceTitle:'', //发票抬头
|
||||
taxpayer:"",//纳税人识别号
|
||||
hedgeFund:"",//对公账号
|
||||
openingBank:"",//开户行
|
||||
name:"",//持卡人姓名
|
||||
},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 提交认证
|
||||
next(){
|
||||
let that = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认提交认证',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
that.do_submit()
|
||||
uni.showToast({
|
||||
title: '资质提交成功!等待客服审核',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async do_submit(){
|
||||
let res = await authentication.authBank(this.form.invoiceTitle,
|
||||
this.form.taxpayer,
|
||||
this.form.openingBank,
|
||||
this.form.hedgeFund,
|
||||
this.form.name)
|
||||
this.handleError(res, res => {
|
||||
})
|
||||
// uni.switchTab({
|
||||
// url:'../my/my'
|
||||
// })
|
||||
uni.redirectTo({
|
||||
url:'../auth/is_Authentication'
|
||||
});
|
||||
},
|
||||
async getInfo() {
|
||||
let data = await authentication.viewBank()
|
||||
let info = data.data
|
||||
if (info) {
|
||||
this.is_edit = false
|
||||
this.form.invoiceTitle = info.invoice_title
|
||||
this.form.taxpayer = info.tax_number
|
||||
this.form.hedgeFund = info.bank_account
|
||||
this.form.openingBank = info.bank_name
|
||||
this.form.name = info.account_name
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getInfo()
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page{
|
||||
background: #F7F7F7;
|
||||
}
|
||||
.place {
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
|
||||
.b_header {
|
||||
|
||||
height: 148upx;
|
||||
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
font-size: 32upx;
|
||||
}
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.progress{
|
||||
color:#FFFFFF;
|
||||
padding-top: 30px;
|
||||
height:200upx;
|
||||
|
||||
}
|
||||
.btn3{
|
||||
width: 340upx;height: 82upx;
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
170
金壶/appV1/pages/auth/certificate.vue
Normal file
170
金壶/appV1/pages/auth/certificate.vue
Normal file
@@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<HeaderTop page_title='认证'></HeaderTop>
|
||||
<!-- <view class="b_header bg-linear-gradient x-text-white d-flex j-sb a-center padding-zy30" style="height:144upx; line-height: 184upx; padding-top:46upx;">
|
||||
<image src="../../static/my/left.png" mode="" class="goback" @click="before()" style="height:30upx; width:18upx;"></image>
|
||||
<view class="" style="font-size: 32upx;">认证</view>
|
||||
<view v-if="is_edit ? false : true" class="" style="font-size: 32upx;" @click="edit()">修改</view>
|
||||
<view v-if="is_edit ? true : false" class="" style="font-size: 32upx;" @click="edit()">取消</view>
|
||||
</view> -->
|
||||
<view class="progress bg-linear-gradient w-100">
|
||||
<uni-steps :options="[{title: '基本信息'}, {title: '资质图片'}, {title: '税务信息'}]" :active=list_index active-color='#FFFFFF'></uni-steps>
|
||||
</view>
|
||||
<!-- 占位 -->
|
||||
<!-- <view class="place"></view> -->
|
||||
<!-- 认证界面 -->
|
||||
<view class="list">
|
||||
<view class="mt-3 scope" v-for="(item,index) of subTypeInfo" :key='index'>
|
||||
<view class="d-flex padding-zy30">
|
||||
<text class="text-danger ml-2 mr-1" v-if="item.required">*</text>
|
||||
<card :headTitle="item.name" :headBorderBottom="false"></card>
|
||||
</view>
|
||||
|
||||
<view class="tui-box-upload d-flex w-100 padding-zy30" style="display: inline-block;">
|
||||
<tui-upload :limit="1" :fileKey="item.value" :value="item.path" :fileKeyName="'app'" @complete="result" @remove="remove" style="display: inline-block; float: left;height:200upx; width:300upx;"></tui-upload>
|
||||
<view v-if="item.required && item.image" style="float: right;">
|
||||
<image :src="item.image" mode="" class="eg_img" style="" @tap='look_img(item.image)'></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-if="item.required && item.image">
|
||||
<image :src="item.image" mode="" class="eg_img" style=""></image>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 editBtn w-90" style="line-height: 80upx;" @click="next()">下一步</view>
|
||||
<!-- 按钮 -->
|
||||
<!-- <view class="d-flex bottom-0 right-0 w-100 " >
|
||||
<view class="flex-1 main-bg-color text-white font-md py-2 text-center btn3"
|
||||
hover-class="main-bg-hover-color" @click="before()">上一步</view>
|
||||
<view class="flex-1 bg-danger text-white font-md py-2 text-center btn3"
|
||||
hover-class="main-bg-hover-color" @click="next()">{{is_edit ? '立即提交':'下一页'}}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import authentication from '../../utils/models/auth.js'
|
||||
import tuiUpload from '@/components/tui-upload/tui-upload'
|
||||
import tui from '@/components/tui-upload/tui'
|
||||
import PublicTop from '../../components/HeaderTop/PublicTop.vue'
|
||||
import card from "@/components/common/card_.vue"
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
export default {
|
||||
components: {
|
||||
PublicTop,
|
||||
card,
|
||||
tuiUpload,
|
||||
tui,
|
||||
HeaderTop
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list_index:1,
|
||||
is_show:true,
|
||||
business_license:[],//资质url
|
||||
sub_type:'', //企业类型
|
||||
imageData: [],
|
||||
showRigth: false,
|
||||
subTypeInfo:[]
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 查看图片
|
||||
look_img(path){
|
||||
let arr = []
|
||||
arr.push(path)
|
||||
if (!path) return;
|
||||
uni.previewImage({
|
||||
loop: true,
|
||||
urls: arr
|
||||
})
|
||||
},
|
||||
result: function(e) {
|
||||
this.is_show = false
|
||||
if(e.status == 1){
|
||||
this.subTypeInfo.forEach(item => {
|
||||
if(item.value == e.key ){
|
||||
item.path[0] = e.pathArr[0]
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
// console.log(this.subTypeInfo)
|
||||
},
|
||||
remove: function(e) {
|
||||
//移除图片
|
||||
this.subTypeInfo.forEach(item => {
|
||||
if(item.value == e.key ){
|
||||
item.path = []
|
||||
return
|
||||
}
|
||||
})
|
||||
},
|
||||
async viewCertificate() {
|
||||
let data = await authentication.viewCertificate()
|
||||
this.subTypeInfo = data.data
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async next() {
|
||||
let parames = {
|
||||
sub_type:this.sub_type,
|
||||
role_type:'buyer'
|
||||
}
|
||||
for (let i = 0; i < this.subTypeInfo.length; i++) {
|
||||
if(this.subTypeInfo[i].path){
|
||||
parames[this.subTypeInfo[i].value] = this.subTypeInfo[i].path[0]
|
||||
}
|
||||
}
|
||||
let data = await authentication.authCertificate(parames)
|
||||
uni.navigateTo({
|
||||
url: '../auth/bank'
|
||||
})
|
||||
this.handleError(data, res => {
|
||||
})
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
if(this.is_show){
|
||||
this.viewCertificate()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content{
|
||||
background-color:#F2F2F2;
|
||||
.b_header {
|
||||
padding-top: 60upx;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
font-size: 32upx;
|
||||
}
|
||||
}
|
||||
.progress{
|
||||
color:#FFFFFF;
|
||||
padding-top: 30px;
|
||||
height:200upx;
|
||||
|
||||
}
|
||||
.eg_img{
|
||||
height: 200upx;
|
||||
/* width:150upx; */
|
||||
width: 300upx;
|
||||
margin-bottom:20upx;
|
||||
}
|
||||
.list{
|
||||
height:calc(100% - 240upx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
136
金壶/appV1/pages/auth/is_Authentication.vue
Normal file
136
金壶/appV1/pages/auth/is_Authentication.vue
Normal file
@@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<view class="content w-100 h-100">
|
||||
<HeaderTop page_title='认证'></HeaderTop>
|
||||
<view class=" list">
|
||||
<view class="padding-30 x-bg-white d-flex j-sb">
|
||||
<view class="d-flex">
|
||||
<view class="font-weight font_28">当前企业信息</view>
|
||||
<!-- <view class="margin-zy20 bg_F2F2F2" style="border-radius: 50upx; padding:2upx 14upx;">未认证</view> -->
|
||||
<!-- <view class="margin-zy20 x-text-white" style="border-radius: 50upx; padding:2upx 14upx; background-color: #edca4a;">待审核</view>
|
||||
<view class="margin-zy20 x-text-white" style="border-radius: 50upx; padding:2upx 14upx; background-color: #008be6;">已认证</view> -->
|
||||
|
||||
|
||||
<view v-if="authStatus != 'auditing' && authStatus != 'waiting' && authStatus != 'finish'" class="margin-zy20 bg_F2F2F2" style="border-radius: 50upx; padding:2upx 14upx;">未认证</view>
|
||||
<view v-if="authStatus == 'waiting'" class="margin-zy20 x-text-white" style="border-radius: 50upx; padding:2upx 14upx;background-color: #FF0000;">未通过</view>
|
||||
<view v-if="authStatus == 'auditing'" class="margin-zy20 x-text-white" style="border-radius: 50upx; padding:2upx 14upx; background-color: #edca4a;">待审核</view>
|
||||
<view v-if="authStatus == 'finish'" class="margin-zy20 x-text-white" style="border-radius: 50upx; padding:2upx 14upx; background-color: #008be6;">已认证</view>
|
||||
</view>
|
||||
<view v-if="authStatus != 'auditing' && authStatus != 'waiting' && authStatus != 'finish'" class="x-text-159 text-right lookAll" @tap='to_auth()'>去认证</view>
|
||||
<view v-if="authStatus == 'waiting' || authStatus == 'finish'" class="x-text-159 text-right lookAll" @tap='to_auth()'>重新认证</view>
|
||||
</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;" v-if="authStatus == 'auditing' || authStatus == 'waiting' || authStatus == 'finish'"></view>
|
||||
<view class="x-bg-white padding-30" v-if="authStatus == 'auditing' || authStatus == 'waiting'|| authStatus == 'finish'">
|
||||
|
||||
<view class="d-flex">
|
||||
<view>企业名称</view>
|
||||
|
||||
<view class="margin-zy20">{{info.name}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view>企业地址</view>
|
||||
<view class="margin-zy20">{{regionsName}} {{info.business_address}}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;" v-if="authStatus == 'auditing' || authStatus == 'waiting' || authStatus == 'finish'"></view>
|
||||
<view v-if="authStatus == 'auditing' || authStatus == 'waiting' || authStatus == 'finish'">
|
||||
<view class="padding-30 x-bg-white j-sb d-flex">
|
||||
<view class="font-weight font_28">资质图片</view>
|
||||
<view class="x-text-159 lookAll" @tap='look_all()'>查看全部></view>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="imgBox d-flex j-sb padding-zy30">
|
||||
<view class="x_textCenter margin-shu20" v-for="(item,index) of subTypeInfo" :key='index' v-if="item.path[0] || item.image">
|
||||
<img :src="item.path[0]?item.path[0]:item.image" alt="" class='img'>
|
||||
<view>{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import authentication from '../../utils/models/auth.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
info: {},
|
||||
regionsName: '',
|
||||
subTypeInfo: [],
|
||||
authStatus: 'authBaisc',
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
methods: {
|
||||
// look_all
|
||||
look_all() {
|
||||
uni.navigateTo({
|
||||
url: './look_Authentication'
|
||||
})
|
||||
},
|
||||
// 去认证
|
||||
to_auth() {
|
||||
uni.navigateTo({
|
||||
url: './baisc'
|
||||
})
|
||||
},
|
||||
async checkAuth() {
|
||||
let data = await authentication.checkAuth()
|
||||
this.authStatus = data.data
|
||||
if(this.authStatus == 'auditing' || this.authStatus == 'waiting' || this.authStatus == 'finish'){
|
||||
this.viewBaisc()
|
||||
this.viewCertificate()
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async viewBaisc() {
|
||||
let data = await authentication.viewBaisc()
|
||||
console.log(data)
|
||||
this.info = data.data
|
||||
if (this.info) {
|
||||
this.regionsName = this.info.area_name.map(item => item.area_name).join(' ')
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async viewCertificate() {
|
||||
let data = await authentication.viewCertificate()
|
||||
this.subTypeInfo = data.data
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.checkAuth()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.list {
|
||||
.imgBox {
|
||||
flex-wrap: wrap;
|
||||
|
||||
.img {
|
||||
height: 208upx;
|
||||
width: 327upx;
|
||||
}
|
||||
}
|
||||
|
||||
.lookAll {
|
||||
border: 2upx solid #EB5159;
|
||||
border-radius: 50upx;
|
||||
padding: 2upx 14upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
296
金壶/appV1/pages/auth/look_Authentication.vue
Normal file
296
金壶/appV1/pages/auth/look_Authentication.vue
Normal file
@@ -0,0 +1,296 @@
|
||||
<template>
|
||||
<view class="content w-100 h-100">
|
||||
<HeaderTop page_title='认证'></HeaderTop>
|
||||
<view class="x-bg-white padding-30 font-weight">当前企业信息</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;"></view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
企业名称</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.name" placeholder="请输入企业名称" :disabled="true" />
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
企业类型
|
||||
</view>
|
||||
<view class="uni-list-cell-db px-1 font-md flex-1">
|
||||
<picker @change="bindPickerChange" :value="index" :range="list" range-key="name" :disabled="true">
|
||||
<view class="uni-input">{{list[index].name}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<pick-regions :defaultRegions="defaultRegions" :defaultDisabled="true" @getRegions="handleGetRegions">
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
注册区域
|
||||
</view>
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
{{regionsName}}
|
||||
</view>
|
||||
</view>
|
||||
</pick-regions>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
详细地址</view>
|
||||
<input placeholder="(请输入营业执照上的详细地址)" class="px-1 font-md flex-1" type="text" v-model="form.detailPath" :disabled="true"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
收货人</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.linkman" :disabled="true"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
手机号</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.phone" :disabled="true"/>
|
||||
</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;"></view>
|
||||
<view class="x-bg-white font-weight padding-30">税务信息</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;"></view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
发票抬头</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="bank.invoiceTitle" :disabled="true"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
纳税人识别码</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="bank.taxpayer" :disabled="true"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
开户行</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="bank.openingBank" :disabled="true"/>
|
||||
</view>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
对公账号</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="bank.hedgeFund" :disabled="true"/>
|
||||
</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;"></view>
|
||||
<view class="x-bg-white padding-30 font-weight">资质图片</view>
|
||||
<view class="line bg_F2F2F2 w-100" style="height:10upx;"></view>
|
||||
<view class="imgBox d-flex j-sb padding-30">
|
||||
<view class="imgBox d-flex j-sb padding-zy30">
|
||||
<view class="x_textCenter margin-shu20" v-for="(item,index) of subTypeInfo" :key='index' v-if="item.path[0] || item.image">
|
||||
<!-- <img :src="item.path[0]?item.path[0]:item.image" alt="" class='img'> -->
|
||||
<image :src="item.path[0]?item.path[0]:item.image" alt="" class='img'></image>
|
||||
<view>{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import pickRegions from '@/components/pick-regions/pick-regions.vue'
|
||||
import authentication from '../../utils/models/auth.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import commonPopup from "@/components/common/common-popup.vue"
|
||||
import shippingAddress from '../../utils/models/shop.js'
|
||||
export default {
|
||||
components: {
|
||||
commonPopup,
|
||||
HeaderTop,
|
||||
pickRegions
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list_index: 1,
|
||||
regions: [],
|
||||
defaultRegions: ['安徽省', '合肥市', '蜀山区'],
|
||||
area_id: 2,
|
||||
list: [{
|
||||
key: 'purchasing_enterprise',
|
||||
name: '商业公司'
|
||||
},
|
||||
{
|
||||
key: 'purchasing_chain_boss',
|
||||
name: '连锁药房(总店)'
|
||||
},
|
||||
{
|
||||
key: 'liansuo_drugstore',
|
||||
name: '连锁药房(分店)'
|
||||
},
|
||||
{
|
||||
key: 'drugstore',
|
||||
name: '单体药房'
|
||||
},
|
||||
{
|
||||
key: 'clinic_single',
|
||||
name: '单体诊所'
|
||||
},
|
||||
{
|
||||
key: 'clinic_door',
|
||||
name: '门诊'
|
||||
},
|
||||
{
|
||||
key: 'clinic_community',
|
||||
name: '社区卫生服务所'
|
||||
},
|
||||
{
|
||||
key: 'hospital_private',
|
||||
name: '私立医院'
|
||||
}
|
||||
],
|
||||
index: 0,
|
||||
current: 0,
|
||||
form: {
|
||||
path: '', //地址
|
||||
name: "", //企业名称
|
||||
type: "", //企业类型
|
||||
detailPath: "", //详细地址
|
||||
linkman: "", //联系人姓名
|
||||
kefu: '' //客服
|
||||
},
|
||||
bank:{
|
||||
|
||||
},
|
||||
subTypeInfo:[],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bindPickerChange: function(e) {
|
||||
this.index = e.detail.value
|
||||
this.form.sub_type = this.list[this.index].key
|
||||
},
|
||||
before() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
async do_auth() {
|
||||
let parames = {
|
||||
name: this.form.name,
|
||||
area_id: this.area_id,
|
||||
sub_type: this.form.sub_type,
|
||||
business_address: this.form.detailPath,
|
||||
consignee: this.form.linkman,
|
||||
phone: this.form.phone,
|
||||
service_number: this.form.kefu,
|
||||
}
|
||||
let res = await authentication.authBaisc(parames);
|
||||
uni.redirectTo({
|
||||
url: '../auth/certificate'
|
||||
})
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
let data = await authentication.viewBaisc()
|
||||
let info = data.data
|
||||
if (info) {
|
||||
this.form.name = info.name
|
||||
this.area_id = info.area_id
|
||||
this.form.sub_type = info.sub_type
|
||||
this.form.detailPath = info.business_address
|
||||
this.form.linkman = info.consignee
|
||||
this.form.phone = info.tel
|
||||
this.form.kefu = info.service_number
|
||||
this.regions = info.area_name
|
||||
for (let i in this.list) {
|
||||
if (this.form.sub_type == this.list[i]['key']) {
|
||||
this.index = i
|
||||
}
|
||||
}
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 获取选择的地区
|
||||
handleGetRegions(regions) {
|
||||
this.regions = regions
|
||||
this.area_id = this.regions.map(item => item.id).join('-')
|
||||
},
|
||||
async viewCertificate() {
|
||||
let data = await authentication.viewCertificate()
|
||||
this.subTypeInfo = data.data
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async viewBank() {
|
||||
let data = await authentication.viewBank()
|
||||
let info = data.data
|
||||
if (info) {
|
||||
this.bank.invoiceTitle = info.invoice_title
|
||||
this.bank.taxpayer = info.tax_number
|
||||
this.bank.hedgeFund = info.bank_account
|
||||
this.bank.openingBank = info.bank_name
|
||||
this.bank.account_name = info.account_name
|
||||
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
regionsName() {
|
||||
// 转为字符串
|
||||
return this.regions.map(item => item.area_name).join(' ')
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getInfo()
|
||||
this.viewBank()
|
||||
this.viewCertificate()
|
||||
},
|
||||
created() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.place {
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
|
||||
.b_header {
|
||||
height: 148upx;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.content {
|
||||
.imgBox {
|
||||
flex-wrap: wrap;
|
||||
|
||||
.img {
|
||||
height: 208upx;
|
||||
width: 327upx;
|
||||
}
|
||||
}
|
||||
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.progress {
|
||||
color: #FFFFFF;
|
||||
padding-top: 30px;
|
||||
height: 200upx;
|
||||
|
||||
}
|
||||
</style>
|
||||
1
金壶/appV1/pages/classification/.pydio
Normal file
1
金壶/appV1/pages/classification/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
d8869ed1-8c9c-40b8-a5d9-9782d6efde0b
|
||||
159
金壶/appV1/pages/classification/classification.vue
Normal file
159
金壶/appV1/pages/classification/classification.vue
Normal file
@@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<view class="d-flex border-top faster" style="height: 100%;box-sizing: border-box;">
|
||||
<view class="container bg_F2F2F2">
|
||||
<view class="b_header bg-linear-gradient x-text-white text-center">
|
||||
分类
|
||||
</view>
|
||||
<view class="contant_list">
|
||||
<view class="list padding-zy30" v-for="(item,index) in list" :key='index'>
|
||||
<view class="font-weight title">{{item.name}}</view>
|
||||
<view class="d-flex list_items">
|
||||
<view class="box x-bg-white" v-for='(item1,index1,key) in item.sub_cate' :key='index1' @tap='to_goodsDetail(item1,index,key)' >
|
||||
<view v-if="!item1.show">{{item1.name}}</view>
|
||||
<image v-if="item1.show" src="../../static/home/xia.png" mode="" style="height:18upx; width:30upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
menu_index: 0,
|
||||
list: [], // 分类列表菜单
|
||||
all:[]
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$route'(to, from) {
|
||||
if(to.path=='/pages/classfication/classfication' && (from.path == '/pages/shoppingCart/shoppingCart' || from.path == '/pages/home/home' || from.path == '/pages/my/my')){
|
||||
this.classification();
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.classification();
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 进去详情页
|
||||
to_goodsDetail(item,index,key) {
|
||||
if(key == 8 && item.show){
|
||||
let arr = this.all[item.pid]
|
||||
let int = 0
|
||||
this.list[index].sub_cate.pop()
|
||||
for (let j in arr) {
|
||||
int++
|
||||
if(int>8){
|
||||
this.list[index].sub_cate.push(arr[j])
|
||||
}
|
||||
}
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url: '../home/search-list?cate_id=' + item.cate_id
|
||||
})
|
||||
}
|
||||
},
|
||||
// 分类列表
|
||||
async classification() {
|
||||
this.list = []
|
||||
let res = await X_goods.x_Classification()
|
||||
for (let i in res.data) {
|
||||
let arr = res.data[i].sub_cate
|
||||
let son = []
|
||||
let int = 0
|
||||
this.all[i] = []
|
||||
for (let j in arr) {
|
||||
int++
|
||||
if(int<=8){
|
||||
son.push(arr[j])
|
||||
}
|
||||
if(int==9){
|
||||
let parames = {
|
||||
name:'',
|
||||
pid:arr[j].pid,
|
||||
show : true
|
||||
}
|
||||
son.push(parames)
|
||||
}
|
||||
this.all[i].push(arr[j])
|
||||
}
|
||||
res.data[i].sub_cate = son
|
||||
this.list.push(res.data[i])
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
.b_header{
|
||||
height:148upx;
|
||||
position: relative;
|
||||
line-height:210upx;
|
||||
font-size: 32upx;
|
||||
.goback{
|
||||
position: absolute;
|
||||
bottom:29upx;
|
||||
left:31upx;
|
||||
height:30.9upx;
|
||||
width:18upx;
|
||||
}
|
||||
.message{
|
||||
position: absolute;
|
||||
bottom:18upx;
|
||||
right:31upx;
|
||||
height:43upx;
|
||||
width:50upx;
|
||||
}
|
||||
.spot{
|
||||
height:12upx;
|
||||
width:12upx;
|
||||
background-color: #FF3824;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
bottom:52upx;
|
||||
right:31upx;
|
||||
}
|
||||
}
|
||||
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
.contant_list{
|
||||
height:calc(100% - 148upx);
|
||||
overflow-y: auto;
|
||||
.list{
|
||||
.title{
|
||||
margin: 30upx 0 14upx 0;
|
||||
}
|
||||
.list_items {
|
||||
flex-wrap: wrap;
|
||||
.box{
|
||||
width:33%;
|
||||
padding:30upx 0;
|
||||
text-align: center;
|
||||
margin:0 3upx 3upx 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1
金壶/appV1/pages/home/.pydio
Normal file
1
金壶/appV1/pages/home/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
a7f637e7-db4f-4ce8-939b-868e505ea49a
|
||||
66
金壶/appV1/pages/home/MessageDetails.vue
Normal file
66
金壶/appV1/pages/home/MessageDetails.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<HeaderTop :page_title='MessageInfo.description'></HeaderTop>
|
||||
<view class="padding-30 message">
|
||||
<h2 class="message__details-title">{{MessageInfo.description}}</h2>
|
||||
<div class="message__details-time">2019-10-07 08:00 浏览量238.0万</div>
|
||||
<div class="message__details-info">
|
||||
<p>
|
||||
梦寐以求的小长假就那么过去了
|
||||
上班的心情总是那么沉重
|
||||
上班第一天
|
||||
刚放完假的你
|
||||
是不是这样的
|
||||
|
||||
不过,值得开心的是
|
||||
晴好天气依旧持续
|
||||
阳光明媚
|
||||
气温也似乎变得放飞自我了
|
||||
预计今天的最高气温会攀升到31℃左右
|
||||
</p>
|
||||
</div>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
MessageInfo: {}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.MessageInfo = JSON.parse(option.mess_id);
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.message {
|
||||
&__details-title {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 7rpx;
|
||||
}
|
||||
&__details-time {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
&__details-info {
|
||||
font-size: 32rpx;
|
||||
line-height: 50rpx;
|
||||
letter-spacing: 0.8rpx;
|
||||
color: #000000;
|
||||
.p {
|
||||
|
||||
}
|
||||
img {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
502
金壶/appV1/pages/home/home.vue
Normal file
502
金壶/appV1/pages/home/home.vue
Normal file
@@ -0,0 +1,502 @@
|
||||
<template>
|
||||
<!-- 首页 -->
|
||||
<view class="content bg_F2F2F2 w-100 h-100 home">
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
|
||||
<view class="is_top_search x-bg-white h-100 flex-1 margin-zy20">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img"></image>
|
||||
<input type="text" value="" placeholder="请输入药名/厂家" class="search_input h-100" @input="changeInput($event)" v-model="keyword"
|
||||
@click="search" />
|
||||
<!-- <input type="text" value="" placeholder="搜索" class="search_input h-100" @input="changeInput($event)" v-model="keyword" @focus="to_search()" /> -->
|
||||
</view>
|
||||
<image src="../../static/my/message.png" mode="" class="message" @click="to_mes()"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<view class="is_top_search x-bg-white h-100 flex-1" @click="search()">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img"></image>
|
||||
<input type="text" value="" placeholder="搜索" class="search_input h-100" />
|
||||
</view>
|
||||
<image src="../../static/my/message.png" mode="" class="message" @click="toMes()"></image>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="is_content padding-zy30">
|
||||
<view class="banner margin-shu20">
|
||||
|
||||
<swiper :speed='5000' :autoplay="true" :indicator-dots="true" indicator-color="rgba(255, 255, 255, 0.8)"
|
||||
indicator-active-color="#fff" class="h-100 ">
|
||||
<swiper-item v-for="(item,index) in banner" :key="index">
|
||||
<image class="h-100" :src="'https://'+item.app_pic_url" @click="dump(item.app_controller_name)" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="info x_margin0auto">
|
||||
<!-- 专题 -->
|
||||
<view class="x-bg-white is_box d-flex j-around a-center padding-sx30 border_radius20">
|
||||
<view class="" v-for="(item,index) of activity_icons" :key='index' @tap='productList(item)'>
|
||||
<view class="text-center">
|
||||
<image :src="'../../static/home/b'+ index +'.png'" mode="" class='menu_img'></image>
|
||||
</view>
|
||||
<view>{{item.activity_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 广告 文字滚动 -->
|
||||
<view class="margin-shu20 x-bg-white d-flex a-center padding-zy30 border_radius20">
|
||||
<!-- <img class="mr-2" src="../../static/home/laba.png" alt="" style='height:24upx; width:27upx;'> -->
|
||||
<image class="mr-2" src="../../static/home/laba.png" alt="" style='height:24upx; width:27upx;'></image>
|
||||
<!-- v-for="(item,index) of activity" :key='index' -->
|
||||
<swiper autoplay circular :interval="3000" class="tui-swiper">
|
||||
<swiper-item v-for="(item,index) of activity" :key='index' class="tui-swiper-item">
|
||||
<view class="tui-news-item" @tap='detail(item)'>{{item.description}}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="bannerNew margin-shu20">
|
||||
<!-- <image src="../../static/home/bannernew.png" mode="" class="banner_img h-100 w-100"></image> -->
|
||||
<image src="../../static/home/renzheng.jpg" mode="" class="banner_img h-100 w-100" @tap='to_renzheng()'></image>
|
||||
</view>
|
||||
<!-- 新人优惠 -->
|
||||
<view class=" margin-shu20" v-for="(item,index) of activity_self_true" :key="index" v-if='activity_self_true'>
|
||||
<view class="newren margin-shu20 d-flex a-center">
|
||||
<image src="../../static/home/shu.png" mode="" style="height:30upx; width:6upx;"></image>
|
||||
<view class="" style="color: #FB6246; margin:0 15upx 0 15upx;">{{item.activity_name}}</view>
|
||||
</view>
|
||||
<view class=" new_goods">
|
||||
<view class="new_goods_info x-bg-white border_radius20 a-center text-center j-center" v-for="(item2,index2) in item.goods_list.data"
|
||||
:key="index2" @click="openDetail(item2)">
|
||||
<!-- <view class="text-center w-100 margin-shu20" style="height:94upx;">
|
||||
<image :src="'https://'+item2.pc_thumb" class="newren_img h-100 w-100"></image>
|
||||
</view> -->
|
||||
<view class="text-center w-100 margin-shu20" style="height:174upx; background-repeat: no-repeat;" :style="{backgroundImage: 'url(' + 'https://'+item2.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
|
||||
</view>
|
||||
<view class=" text-center some_txt font-weight d-flex a-center textOVerFlow w-100">
|
||||
<image src="../../static/shoppingCart/zheng.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item2.retail_flag==1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item2.retail_flag==0'></image>
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;" v-if='item2.is_limit==1'></image>
|
||||
<view class="textOVerFlow" style="max-width: 72%;">{{item2.goods_name}}</view>
|
||||
</view>
|
||||
<view class="text-center some_txt textOVerFlow">{{item2.manufacturer_name}}</view>
|
||||
<view class="x_text_hui text-center font-20 d-flex j-sb">
|
||||
{{item2.spec_desc}}
|
||||
|
||||
</view>
|
||||
<view class="x-text-159 text-center font-weight font_28 d-flex j-sb">
|
||||
¥{{item2.price}}
|
||||
</view>
|
||||
</view>
|
||||
<view style="clear: both;"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="d-flex j-sb threetip">
|
||||
<image src="../../static/shoppingCart/fenlan1.jpg" mode="" class='threetip_img'></image>
|
||||
<img src="../../static/shoppingCart/fenlan2.jpg" alt="" class='threetip_img'>
|
||||
<img src="../../static/shoppingCart/fenlan3.jpg" alt="" class='threetip_img'>
|
||||
</view> -->
|
||||
|
||||
<view class="x_list">
|
||||
<view class="list_menu d-flex j-around margin-shu20">
|
||||
<view class="newren" v-for="(item,index) of activity_self_false" :key='index' @click="to_chooseThree(index)" :class='{three_active:index==three_index}'>{{item.activity_name}}</view>
|
||||
</view>
|
||||
<view class="list_box">
|
||||
<view class="d-flex j-sb the_lastGoods">
|
||||
<view class="the_lastGoods_item padding-30 x-bg-white" style="margin-bottom: 15upx;" v-for="(item,index) of goods_list"
|
||||
:key="index" @click="openDetail(item)">
|
||||
<!-- <view class="last_img">
|
||||
<img :src="'https://'+item.pc_thumb" alt="" class='h-100 w-100'>
|
||||
</view> -->
|
||||
<view class="last_img" :style="{backgroundImage: 'url(' + 'https://'+item.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
|
||||
</view>
|
||||
|
||||
<view class="font-weight font_26 dian d-flex a-center">
|
||||
<image src="../../static/shoppingCart/zheng.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item.retail_flag==1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" style="height:30upx; width:30upx; margin-right:15upx;" mode="" v-if='item.retail_flag==0'></image>
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;margin-right:15upx;" v-if='item.is_limit==1'></image>
|
||||
{{item.goods_name}}
|
||||
</view>
|
||||
<view class="x_text_hui zhuyi_title dian">{{item.manufacturer_name}}</view>
|
||||
<view class="x_text_hui text-center font-20 d-flex j-sb">
|
||||
{{item.spec_desc}}
|
||||
|
||||
</view>
|
||||
<view class="x-text-159 text-center font-weight font_28 d-flex j-sb">
|
||||
¥{{item.price}}
|
||||
|
||||
</view>
|
||||
<!-- <view class="dian">{{item.spec_desc}}</view>
|
||||
<view class="d-flex j-sb x_price">
|
||||
<view class="x-text-159 font-weight font_28">{{item.price}}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<uni-popup ref="showimage" type="center" :mask-click="true">
|
||||
<view class="uni-image advertisement">
|
||||
<image class="advertisement__image" src="https://img14.360buyimg.com/mcoss/jfs/t1/116140/21/8057/91328/5ec77230E4e8381be/60b7c090733c5ebb.gif" mode="scaleToFill" />
|
||||
<view class="uni-image-close" @click="cancelAdvertisement()">
|
||||
<uni-icons type="clear" color="#fff" size="30" />
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
<!-- <TabBar page_title=''></TabBar> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_index from '../../utils/models/index.js';
|
||||
import uniNoticeBar from '../../components/components/uni-notice-bar/uni-notice-bar.vue'
|
||||
import TabBar from '../../common/tabBar/tabBar.vue'
|
||||
import uniPopup from '../../components/uni-popup/uni-popup.vue'
|
||||
// import {Config} from '@/utils/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
the_show: true,
|
||||
banner: [], //轮播图
|
||||
activity: [], //消息
|
||||
activity_icons: [],
|
||||
activity_self_true: [],
|
||||
activity_goods_list: '',
|
||||
activity_self_false: [],
|
||||
activity_self_false_index: 0,
|
||||
three_index: 0,
|
||||
goods_list: [], //商品列表
|
||||
the_Authentication: '', // 缓存里面的token 有值代表是登录状态,没值代表用户没有登陆
|
||||
limit: 6,
|
||||
page: 1,
|
||||
loading: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
uniNoticeBar,
|
||||
TabBar,
|
||||
uniPopup
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
|
||||
this.loading = false
|
||||
this.getData()
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.$refs.showimage.open()
|
||||
},
|
||||
methods: {
|
||||
// 关闭开屏弹窗
|
||||
cancelAdvertisement() {
|
||||
this.$refs.showimage.close()
|
||||
},
|
||||
// 去认证
|
||||
to_renzheng(){
|
||||
uni.navigateTo({
|
||||
url: '../auth/is_Authentication'
|
||||
})
|
||||
},
|
||||
//to_search
|
||||
to_search() {
|
||||
|
||||
uni.navigateTo({
|
||||
url: './search'
|
||||
})
|
||||
},
|
||||
// 进入消息页面
|
||||
dump(url) {
|
||||
if (url) {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
})
|
||||
}
|
||||
},
|
||||
// 进入消息页面
|
||||
|
||||
to_mes() {
|
||||
uni.navigateTo({
|
||||
url: '../my/is_message'
|
||||
})
|
||||
},
|
||||
// tab转换商品
|
||||
async to_chooseThree(index) {
|
||||
|
||||
this.activity_self_false_index = index
|
||||
this.the_show = false
|
||||
this.three_index = index;
|
||||
let res = await X_index.x_activity(this.activity_self_false[this.three_index].id, this.limit, this.page, this.loading);
|
||||
this.loading = true
|
||||
this.handleError(res, res => {
|
||||
this.goods_list = res.data.goods_list.data
|
||||
})
|
||||
},
|
||||
|
||||
// 跳转搜索页
|
||||
search() {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search'
|
||||
})
|
||||
},
|
||||
// 跳转详情页
|
||||
openDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '../shoppingCart/goodsDetail?sku_id=' + item.sku_id +'&the_index='+this.three_index
|
||||
})
|
||||
},
|
||||
// 跳转详情页
|
||||
lastOpenDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '../shoppingCart/goodsDetail?sku_id=' + item.gba_id
|
||||
})
|
||||
},
|
||||
// 滚动消息
|
||||
detail(e) {
|
||||
uni.navigateTo({
|
||||
url: `MessageDetails?mess_id=${JSON.stringify(e)}`
|
||||
})
|
||||
},
|
||||
// 商品列表
|
||||
productList(item) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search-list?activity_id=' + item.id
|
||||
})
|
||||
},
|
||||
async getData() {
|
||||
uni.getStorage({
|
||||
key: 'isAuthentication',
|
||||
success: function(res) {
|
||||
if (res.data == '') {
|
||||
|
||||
} else {
|
||||
|
||||
this.the_Authentication = res.data
|
||||
}
|
||||
}
|
||||
});
|
||||
let res = await X_index.x_index();
|
||||
this.handleError(res, res => {
|
||||
if (res.data.banner) {
|
||||
this.banner = res.data.banner
|
||||
}
|
||||
this.activity_icons = res.data.activity_icons
|
||||
if (res.data.activity_self_true) {
|
||||
this.activity_self_true = res.data.activity_self_true
|
||||
}
|
||||
if (res.data.article) {
|
||||
this.activity = res.data.article
|
||||
}
|
||||
if (res.data.activity_self_false) {
|
||||
this.activity_self_false = res.data.activity_self_false
|
||||
}
|
||||
|
||||
if (this.activity_self_false.length > 0) {
|
||||
this.to_chooseThree(0)
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
overflow-y: auto;
|
||||
|
||||
|
||||
.tui-swiper {
|
||||
font-size: 28upx;
|
||||
height: 50upx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tui-swiper-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tui-news-item {
|
||||
line-height: 28upx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #018EEA;
|
||||
}
|
||||
|
||||
.img_list {
|
||||
width: 263upx;
|
||||
height: 150upx;
|
||||
}
|
||||
|
||||
.tab_goods {
|
||||
width: 340upx;
|
||||
height: 420upx;
|
||||
margin: 4upx;
|
||||
border-radius: 20upx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
.is_top {
|
||||
height: 200.4upx;
|
||||
padding-top: 90upx;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
.top_info {
|
||||
height: 56upx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
.is_top_search {
|
||||
overflow: hidden;
|
||||
border-radius: 50upx;
|
||||
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 60upx;
|
||||
top: 16upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
margin-left: 55upx;
|
||||
width: 70%;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-left: 20upx;
|
||||
height: 43upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.banner {
|
||||
height: 387upx;
|
||||
// width: 696upx;
|
||||
margin: 10upx auto 30upx;
|
||||
|
||||
.banner_img {
|
||||
height: 337upx;
|
||||
width: 696upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.info {
|
||||
// width: 696upx;
|
||||
|
||||
.is_box {
|
||||
.menu_img {
|
||||
height: 89upx;
|
||||
width: 88upx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.dong_txt {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bannerNew {
|
||||
height: 235upx;
|
||||
|
||||
|
||||
margin: 30upx auto;
|
||||
}
|
||||
|
||||
.newren {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.new_goods {
|
||||
overflow-x: auto;
|
||||
display: flex;
|
||||
|
||||
|
||||
.new_goods_info {
|
||||
flex: 0 0 280upx;
|
||||
border-right: solid 1px #e5e5e5;
|
||||
color: #5d2a05;
|
||||
margin-right: 15upx;
|
||||
padding: 20upx;
|
||||
|
||||
.some_txt {
|
||||
width: 280upx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.newren_img {
|
||||
// height: 94upx;
|
||||
// width: 175upx;
|
||||
// max-height: 112upx;
|
||||
// max-width: 190upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.threetip_img {
|
||||
height: 158upx;
|
||||
width: 224upx;
|
||||
}
|
||||
|
||||
.three_active {
|
||||
color: #018EEA;
|
||||
border-bottom: 4upx solid #018EEA;
|
||||
}
|
||||
|
||||
.the_lastGoods {
|
||||
|
||||
flex-wrap: wrap;
|
||||
|
||||
.the_lastGoods_item {
|
||||
position: relative;
|
||||
|
||||
border-radius: 20upx;
|
||||
width: 49%;
|
||||
|
||||
.last_img {
|
||||
// width: 263upx;
|
||||
width: 100%;
|
||||
height: 250upx;
|
||||
margin-bottom: 20upx;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
}
|
||||
|
||||
.x_price {
|
||||
position: absolute;
|
||||
bottom: 25upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.is_content {
|
||||
height: calc(100% - 200.4upx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
432
金壶/appV1/pages/home/home1.vue
Normal file
432
金壶/appV1/pages/home/home1.vue
Normal file
@@ -0,0 +1,432 @@
|
||||
<template>
|
||||
<!-- 首页 -->
|
||||
<view class="content bg_F2F2F2 w-100 h-100">
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<view class="is_top_search x-bg-white h-100 flex-1" @click="search()">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img"></image>
|
||||
<input type="text" value="" placeholder="搜索" class="search_input h-100" />
|
||||
</view>
|
||||
<image src="../../static/my/message.png" mode="" class="message"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="banner margin-shu20">
|
||||
<swiper :indicator-dots="true" :autoplay="true" :interval="1000" :duration="100" :circular="true" indicator-color="rgba(255, 255, 255, 0.8)"
|
||||
indicator-active-color="#fff" class="h-100">
|
||||
<swiper-item v-for="(item,index) in banner" :key="index">
|
||||
<!-- <image src="../../static/home/homebanner.png" mode="" class="h-100"></image> -->
|
||||
<image class="h-100" :src="'https://'+item.app_pic_url" />
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="info x_margin0auto padding-sx30">
|
||||
<!-- 专题 -->
|
||||
<view class="x-bg-white is_box d-flex j-around a-center padding-sx30 margin-shu20 border_radius20">
|
||||
<view class="" v-for="(item,index) of activity_icons" :key='index' @tap='productList(item)'>
|
||||
<view class="text-center">
|
||||
<image :src="'../../static/home/b'+ index +'.png'" mode="" class='menu_img'></image>
|
||||
</view>
|
||||
<view>{{item.activity_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 广告 文字滚动 -->
|
||||
<view class="adv margin-shu20 x-bg-white d-flex a-center padding-zy30 border_radius20">
|
||||
<img class="mr-2" src="../../static/home/laba.png" alt="" style='height:24upx; width:27upx;'>
|
||||
<!-- v-for="(item,index) of activity" :key='index' -->
|
||||
<swiper autoplay circular :interval="3000" class="tui-swiper">
|
||||
<swiper-item v-for="(item,index) of activity" :key='index' class="tui-swiper-item">
|
||||
<view class="tui-news-item text-danger" @tap='detail(item.id)'>{{item.description}}</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
<view class="bannerNew margin-shu20">
|
||||
<image src="../../static/home/bannernew.png" mode="" class="banner_img h-100 w-100"></image>
|
||||
</view>
|
||||
<!-- <view v-for="(item,index) of activity_self_true" :key="index">
|
||||
<view class="newren margin-shu20">{{item.activity_name}}</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 测试 -->
|
||||
<!-- <view v-for="(item,index) of activity_self_true">
|
||||
|
||||
<view style="border: 1rpx solid red;" v-for="(item2,index2) in item.goods_list.data" :key="index2">
|
||||
<view>{{item2.name}}</view>
|
||||
</view>
|
||||
|
||||
</view> -->
|
||||
|
||||
<!-- end -->
|
||||
|
||||
<view class=" margin-shu20" v-for="(item,index) of activity_self_true" :key="index">
|
||||
<view class="newren margin-shu20">{{item.activity_name}}</view>
|
||||
<view class="d-flex new_goods">
|
||||
<view class="new_goods_info x-bg-white border_radius20" v-for="(item2,index2) in activity_goods_list" :key="index2"
|
||||
@click="openDetail(item2)">
|
||||
<view class="text-center">
|
||||
<image :src="'https://'+item2.pc_thumb" class="newren_img"></image>
|
||||
</view>
|
||||
<view class="font-weight text-center">{{item2.name}}</view>
|
||||
<view class="x_text_hui text-center font-20">{{item2.spec_desc}}</view>
|
||||
<view class="x-text-159 text-center">¥ {{item2.cost_price}}</view>
|
||||
<view class="x_text_hui text-center" style="text-decoration: line-through;">¥ {{item2.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb threetip">
|
||||
<image src="../../static/shoppingCart/fenlan1.jpg" mode="" class='threetip_img'></image>
|
||||
<img src="../../static/shoppingCart/fenlan2.jpg" alt="" class='threetip_img'>
|
||||
<img src="../../static/shoppingCart/fenlan3.jpg" alt="" class='threetip_img'>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 热卖 -->
|
||||
<view class="last_goods" style="border:1px solid red;">
|
||||
<!-- <view v-for='(item,index) of activity_self_false' :key='index'>
|
||||
<view class="d-flex j-sb " style="border:1px solid red;">
|
||||
<view>{{item.activity_name}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb margin-shu20 the_lastGoods">
|
||||
<view class="the_lastGoods_item padding-30 margin-shu20 x-bg-white" v-for="(item,index) of 3" :key="index">
|
||||
<img :src="'https://'+item.pc_thumb" alt="" class="last_img">
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>登陆后看价格</view>
|
||||
<image src="../../static/font/cart_icon.png" mode="" style="height:40upx; width:40upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="d-flex j-sb">
|
||||
<view class=" text-center d-flex j-around margin-shu20" style="border:1px solid green;" v-for="(item,index) of activity_self_false" :key='index'>
|
||||
<view class="d-flex font-weight" :class='{three_active:index==three_index}' @click="to_chooseThree(index)">{{item.activity_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="d-flex j-sb margin-shu20 the_lastGoods">
|
||||
<view class="the_lastGoods_item padding-30 margin-shu20 x-bg-white" v-for="(item,index) of activity_self_false[this.three_index]" :key="index">
|
||||
<!-- <img :src="'https://'+item.pc_thumb" alt="" class="last_img"> -->
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view>uuuuuuu</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>登陆后看价格</view>
|
||||
<image src="../../static/font/cart_icon.png" mode="" style="height:40upx; width:40upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- <view class="w-100 d-flex goods_same" style="border:1px solid red;">
|
||||
<view class="mr-2 tab_goods" v-for="(item,index) of goods_list" :key="index">
|
||||
<image
|
||||
style="width: 263upx;height: 150upx;"
|
||||
class="img_list ml-3 mt-2 " :src="'https://'+item.pc_thumb" mode="widthFix"></image>
|
||||
<view class="p-2 pt-1">
|
||||
<view class="font-md">{{item.name}}</view>
|
||||
<text class="d-block font text-light-muted">{{item.manufacturer_name}}</text>
|
||||
<text class="d-block font text-light-muted">¥ {{item.spec_desc}}</text>
|
||||
<view class="d-flex my-1">
|
||||
<view class="x-text-159 text-center">¥ {{item.cost_price}}</view>
|
||||
<view class="x_text_hui text-center" style="text-decoration: line-through;">{{item.price}}</view>
|
||||
<image class="ml-auto" src="../../static/font/cart_icon.png" style="width: 40upx;height: 40upx;" @tap="addCart()"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_index from '../../utils/models/index.js';
|
||||
import uniNoticeBar from '../../components/components/uni-notice-bar/uni-notice-bar.vue'
|
||||
|
||||
|
||||
|
||||
|
||||
// import {Config} from '@/utils/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
banner: [], //轮播图
|
||||
activity: [], //消息
|
||||
activity_icons: [],
|
||||
activity_self_true: [],
|
||||
activity_goods_list: '',
|
||||
activity_self_false: [],
|
||||
activity_self_false_index: 0,
|
||||
three_index: 0,
|
||||
goods_list: [], //商品列表
|
||||
|
||||
limit: 6,
|
||||
page: 1,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
uniNoticeBar,
|
||||
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.getData();
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// tab转换商品
|
||||
async to_chooseThree(index) {
|
||||
|
||||
this.three_index = index
|
||||
let res = await X_index.x_activity(this.activity_self_false[this.three_index].id, this.limit, this.page);
|
||||
this.handleError(res, res => {
|
||||
this.goods_list = res.data.goods_list.data
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 跳转搜索页
|
||||
search() {
|
||||
uni.navigateTo({
|
||||
url: 'search'
|
||||
})
|
||||
},
|
||||
// 跳转详情页
|
||||
openDetail(item) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: '../shoppingCart/goodsDetail?sku_id=' + item.gba_id
|
||||
})
|
||||
},
|
||||
// 滚动消息
|
||||
detail(e) {
|
||||
|
||||
|
||||
},
|
||||
// 商品列表
|
||||
productList(e) {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search-list?activity_id=' + e.id
|
||||
})
|
||||
},
|
||||
// 加入购物车
|
||||
addCart() {
|
||||
|
||||
},
|
||||
async getData() {
|
||||
let res = await X_index.x_index();
|
||||
this.handleError(res, res => {
|
||||
|
||||
|
||||
|
||||
var banner = res.data.banner
|
||||
this.banner = banner
|
||||
var activity = res.data.activity_icons
|
||||
this.activity_icons = activity
|
||||
var activity_self = res.data.activity_self_true
|
||||
this.activity_self_true = activity_self
|
||||
this.activity_goods_list = activity_self[0].goods_list.data
|
||||
var articleInfo = res.data.article
|
||||
this.activity = articleInfo
|
||||
var activity_self_false = res.data.activity_self_false
|
||||
this.activity_self_false = activity_self_false
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
overflow-y: auto;
|
||||
|
||||
.the_lastGoods {
|
||||
// border: 1px solid red;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.the_lastGoods_item {
|
||||
border-radius: 20upx;
|
||||
overflow: hidden;
|
||||
width: 49%;
|
||||
// border: 1px solid green;
|
||||
|
||||
.last_img {
|
||||
height: 150upx;
|
||||
width: 262upx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.tui-swiper {
|
||||
font-size: 28upx;
|
||||
height: 50upx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tui-swiper-item {
|
||||
display: flex;
|
||||
align-items: center
|
||||
}
|
||||
|
||||
.tui-news-item {
|
||||
line-height: 28upx;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.img_list {
|
||||
width: 263upx;
|
||||
height: 150upx;
|
||||
}
|
||||
|
||||
.tab_goods {
|
||||
width: 340upx;
|
||||
height: 420upx;
|
||||
margin: 4upx;
|
||||
border-radius: 20upx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
.is_top {
|
||||
height: 299.4upx;
|
||||
padding-top: 66upx;
|
||||
overflow: hidden;
|
||||
|
||||
|
||||
.top_info {
|
||||
|
||||
height: 56upx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
|
||||
|
||||
.is_top_search {
|
||||
overflow: hidden;
|
||||
border-radius: 20upx;
|
||||
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 40upx;
|
||||
top: 16upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
margin-left: 70upx;
|
||||
width: 70%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-left: 20upx;
|
||||
height: 43upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.banner {
|
||||
height: 387upx;
|
||||
width: 696upx;
|
||||
margin: -140upx auto 0;
|
||||
|
||||
.banner_img {
|
||||
height: 337upx;
|
||||
width: 696upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.info {
|
||||
width: 696upx;
|
||||
|
||||
.is_box {
|
||||
.menu_img {
|
||||
height: 89upx;
|
||||
width: 88upx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.dong_txt {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bannerNew {
|
||||
height: 235upx;
|
||||
width: 696upx;
|
||||
}
|
||||
|
||||
.newren {
|
||||
font-size: 32upx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.new_goods {
|
||||
|
||||
overflow-x: auto;
|
||||
|
||||
.new_goods_info {
|
||||
padding: 40upx;
|
||||
width: 234upx;
|
||||
margin-right: 30upx;
|
||||
|
||||
.newren_img {
|
||||
height: 94upx;
|
||||
width: 175upx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.last_goodsItem {
|
||||
padding: 40upx;
|
||||
width: 350upx;
|
||||
margin-right: 30upx;
|
||||
|
||||
.newren_img {
|
||||
height: 94upx;
|
||||
width: 175upx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.threetip_img {
|
||||
height: 158upx;
|
||||
width: 224upx;
|
||||
}
|
||||
|
||||
.three_active {
|
||||
color: #018EEA;
|
||||
border-bottom: 4upx solid #018EEA;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
913
金壶/appV1/pages/home/search-list.vue
Normal file
913
金壶/appV1/pages/home/search-list.vue
Normal file
@@ -0,0 +1,913 @@
|
||||
<template>
|
||||
<view class="contant">
|
||||
<!-- 排序|筛选 -->
|
||||
<view class="topfind">
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<image src="../../static/my/left.png" mode="" style="height:30upx; width:19upx; padding-right:30upx;" @click="boback()"></image>
|
||||
<view class="is_top_search x-bg-white h-100 flex-1">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img" @click="search"></image>
|
||||
<input type="text" v-model="keyword" confirm-type="search" @confirm="search" placeholder="请输入药名/厂家" ref="myInput"
|
||||
class="search_input h-100" @input="changeInput($event)" />
|
||||
<image class="closeicon" v-if="keyword!=''" @click="removewored()" src="../../static/shoppingCart/cancel.png" mode=""></image>
|
||||
<view class="search_liandong bg_F2F2F2 shadow" v-if='flag==true'>
|
||||
<view class="border-bottom x-bg-white search_items" v-for='(item,index) in search_liandong' :key='index' @tap='to_choose(item)'>{{item.name}}({{item.manufacturer_name}})</view>
|
||||
</view>
|
||||
<!-- <input type="text" value="" placeholder="搜索" class="search_input h-100" @input="changeInput($event)" v-model="keyword" /> -->
|
||||
</view>
|
||||
<!-- <image src="../../static/my/message.png" mode="" class="message" @click="to_mes()"></image> -->
|
||||
<!-- <img src="../../static/my/carw.png" class="message" alt="" @tap="to_car()"> -->
|
||||
<image src="../../static/my/carw.png" class="message" alt="" @tap="to_car()"></image>
|
||||
|
||||
<view class="car_GoodsNum" v-if='car_GoodsNum>0'>{{car_GoodsNum}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list_menu d-flex j-around padding-zy30">
|
||||
<view @click="chooseMenu(0)" :class="{active_menu:menu_index==0}">综合</view>
|
||||
<view @click="chooseMenu(1)" :class="{active_menu:menu_index==1}" class="d-flex a-center">
|
||||
<view>销量</view>
|
||||
<image src="../../static/shoppingCart/shangxia_hui.png" mode="" class="paixu" v-if="is_saleClickMenu==false"></image>
|
||||
<image src="../../static/shoppingCart/up_paixu.png" mode="" class="paixu" v-if='sale_menu_flag==true && is_saleClickMenu==true'></image>
|
||||
<image src="../../static/shoppingCart/down_paixu.png" mode="" class="paixu" v-if='sale_menu_flag==false && is_saleClickMenu==true'></image>
|
||||
</view>
|
||||
<view @click="chooseMenu(2)" :class="{active_menu:menu_index==2}" class="d-flex a-center">
|
||||
<view>价格</view>
|
||||
<image src="../../static/shoppingCart/shangxia_hui.png" mode="" class="paixu" v-if="is_priceClickMenu==false"></image>
|
||||
<image src="../../static/shoppingCart/up_paixu.png" mode="" class="paixu" v-if='price_menu_flag==true && is_priceClickMenu==true'></image>
|
||||
<image src="../../static/shoppingCart/down_paixu.png" mode="" class="paixu" v-if='price_menu_flag==false && is_priceClickMenu==true'></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="list_menu d-flex j-around padding-zy30">
|
||||
<view v-for='(item,index) of list_menu' :key='index' :class="{active_menu:index==menu_index}" @click="chooseMenu(index)">{{item.name}}</view>
|
||||
</view> -->
|
||||
<view class="no_img" v-if='list.length<=0'>
|
||||
<image src="../../static/shoppingCart/nopic.png" mode="" class="no_img"></image>
|
||||
<view class="text-center x_text_hui">{{data_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<view class="list padding-30 bg_F2F2F2" v-if='list.length>0'>
|
||||
<view class="list_items x-bg-white margin-bottom22" v-for="(item,index) in list" :key="index">
|
||||
<view class="d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<!-- <view class="box_img" @click="goodsDetail(item)">
|
||||
<an-image :src="'https://'+item.pc_thumb" alt="https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg"></an-image>
|
||||
</view> -->
|
||||
<view class="box_img" @click="goodsDetail(item)" :style="{backgroundImage: 'url(' + 'https://'+item.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
</view>
|
||||
<view class="goods_txt" style="width:65%;" @click="goodsDetail(item)">
|
||||
<view class="d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;margin-right:30upx;"
|
||||
v-if='item.is_limit==1'></image>
|
||||
<image src="../../static/shoppingCart/re.png" mode="" style="height:30upx; width:30upx;margin-right:30upx;" v-if='item.supplier_id<=10000'></image>
|
||||
<view class="font_28 some_txt font-weight flex-1 ">{{item.goods_name}}</view>
|
||||
</view>
|
||||
<view class="x-text-159" v-if='item.is_limit==1'>{{item.limit_info}}</view>
|
||||
<view class="textOVerFlow">{{item.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
{{item.spec_desc}}
|
||||
<image src="../../static/shoppingCart/zheng.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='item.retail_flag == 1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='item.retail_flag == 0'></image>
|
||||
{{item.retail_flag==0?item.retail_num:item.entirety_num}}{{item.unit}}/件
|
||||
</view>
|
||||
<view class="x-text-159 font-weight font_28">¥ {{item.price}}</view>
|
||||
<image src="../../static/font/cart_icon.png" mode="" class='x_car' alt="" @click.stop='toAdd_car(item)'></image>
|
||||
</view>
|
||||
<!-- <view class="goods_txt flex-1" @click="goodsDetail(item)">
|
||||
<view class="font-weight font_28">{{item.goods_name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="">{{item.factory_name}}</view>
|
||||
<view class="d-flex">{{item.spec_desc}} {{item.retail_flag == 0 ? "零":"整"}} {{item.retail_flag==0?item.retail_num:item.entirety_num}}{{item.unit}}/件</view>
|
||||
<view class="font_28 font-weight x-text-159">{{item.price}}</view>
|
||||
<img src="../../static/font/cart_icon.png" class='x_car' alt="" @click.stop='toAdd_car(item)'>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loading-world" v-if="isScroll">
|
||||
<image class="loading-img" src="../../static/my/loading.gif" alt=""></image>
|
||||
加载中......
|
||||
</view>
|
||||
|
||||
<view class="loading-world" v-if="!isScroll">—————— 已经到底了 ——————</view>
|
||||
</view>
|
||||
<!-- 购物车遮挡层 -->
|
||||
<view class="car_pop h-100 w-100" v-if="is_pop_show==true" @tap='cancel_popCar()'>
|
||||
<view class="pop_box bg-white w-100" style="background-color: #FFFFFF;" @tap.stop='stop_click()'>
|
||||
<view class="pop_goods_info d-flex a-center padding-zy64">
|
||||
|
||||
<!-- <image src="../../static/shoppingCart/cancel.png" mode="" @click="cancel_popCar()" class="cancel_pop"></image> -->
|
||||
<view class="pop_box_img d-flex">
|
||||
<image v-if='is_pop_car' :src="'https://'+is_pop_car.pc_thumb" mode="" class="pop_img"></image>
|
||||
<view>
|
||||
<view class="d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;" v-if='is_pop_car.is_limit==1'></image>
|
||||
<view class="font_28 some_txt font-weight" style="margin-left:30upx;">{{is_pop_car.goods_name}}</view>
|
||||
</view>
|
||||
<view class="x-text-159" v-if='is_pop_car.is_limit==1'>{{is_pop_car.limit_info}}</view>
|
||||
<view class="">{{is_pop_car.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
{{is_pop_car.spec_desc}}
|
||||
<image src="../../static/shoppingCart/zheng.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='is_pop_car.retail_flag == 1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;"
|
||||
v-if='is_pop_car.retail_flag == 0'></image>
|
||||
{{is_pop_car.retail_flag==0?is_pop_car.retail_num:is_pop_car.entirety_num}}{{is_pop_car.unit}}/件
|
||||
</view>
|
||||
<view class="x-text-159 font-weight font_28">¥ {{is_pop_car.price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address">
|
||||
<view class="x_text_hei2828">选择购买数量</view>
|
||||
<view class="d-flex j-sb a-center">
|
||||
<view class="x-text-159 x-text-font24">小提示:该物品购买数量必须为包装的倍数</view>
|
||||
<view class="goods_count d-flex">
|
||||
<view class="bianji_cars_num bianji_cars_numJian" @click="reduse_goodsNum()">-</view>
|
||||
<input type="number" value="" class="bianji_cars_num bianji_cars_numAdd uni-input" cursor-spacing="0" v-model="goods_num" />
|
||||
<view class="bianji_cars_num bianji_cars_numAdd" @click="add_goodsNum()">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="x-bg-159 x_public_box pop_sure x-text-white w-90" @click="sure_btn()">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import {
|
||||
Config
|
||||
} from '../../utils/config.js'
|
||||
import tuiIcon from "@/components/icon/icon"
|
||||
import uniDrawer from "@/components/uni-ui/uni-drawer/uni-drawer.vue"
|
||||
import card from "@/components/common/card.vue"
|
||||
import zcmRadioGroup from "@/components/common/radio-group.vue"
|
||||
import zcmRadioGroupNew from "@/components/common/radio-group__.vue"
|
||||
import radioGroupSell from "@/components/common/radio-group-sell.vue"
|
||||
import anImage from '@/components/an-image/an-image'
|
||||
import searchList from "@/components/search-list/search-list.vue"
|
||||
export default {
|
||||
components: {
|
||||
tuiIcon,
|
||||
uniDrawer,
|
||||
card,
|
||||
zcmRadioGroup,
|
||||
zcmRadioGroupNew,
|
||||
searchList,
|
||||
radioGroupSell,
|
||||
anImage
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
page: 1,
|
||||
isScroll: true,
|
||||
data_text: '数据加载中...',
|
||||
car_GoodsNum: 0, //购物车的商品数量
|
||||
is_pop_show: false,
|
||||
goods_num: 0, // 商品的当前数量
|
||||
is_pop_car: '', // 购物车弹框里面的数据
|
||||
manufacturer_name: '',
|
||||
menu_index: 0,
|
||||
list_menu: [{
|
||||
name: '综合'
|
||||
}, {
|
||||
name: '销量'
|
||||
}, {
|
||||
name: '价格'
|
||||
}],
|
||||
// 收索分页
|
||||
current_page: 1,
|
||||
|
||||
keyword: "", //关键词
|
||||
cate_id: '', //分类id
|
||||
activity_id: '', //活动id
|
||||
retail_flag: '', // 零整标志:0-零售,1-整件售 允许值: 0, 1
|
||||
sort_field: '', //排序字段"default", "sale", "price", "term_validity"
|
||||
sort_order: '', //排序规则 :0-升序,1-降序
|
||||
price_start: '', //价格区间起点
|
||||
price_end: '', //价格区间只能终点
|
||||
term_validity: '', // 效期:0 半年以上,1 一年以上,2 所有,3 近效期(90天内) 默认值: 2 允许值: 0, 1, 2, 3
|
||||
drug_form: '', // 剂型
|
||||
manufacturer: '', // // 生产厂家
|
||||
list: [],
|
||||
showRigth: false,
|
||||
is_key: '',
|
||||
search_liandong: '',
|
||||
flag: '',
|
||||
sale_menu_flag : false,
|
||||
price_menu_flag : false,
|
||||
is_saleClickMenu:false, // 判断销量是否点击了菜单
|
||||
is_priceClickMenu:false, // 判断价格是否点击了菜单
|
||||
screen: {
|
||||
currentIndex: 0,
|
||||
list: [
|
||||
// status选中状态
|
||||
{
|
||||
name: "综合",
|
||||
status: 2,
|
||||
key: "default"
|
||||
},
|
||||
{
|
||||
name: "销量",
|
||||
status: 0,
|
||||
key: "sale"
|
||||
},
|
||||
{
|
||||
name: "价格",
|
||||
status: 0,
|
||||
key: "price"
|
||||
}
|
||||
]
|
||||
},
|
||||
// 生产厂家
|
||||
label2: {
|
||||
selected: 0,
|
||||
list: []
|
||||
},
|
||||
//剂型
|
||||
label3: {
|
||||
selected: 0,
|
||||
list: []
|
||||
},
|
||||
// 售卖
|
||||
label4: {
|
||||
selected: 0,
|
||||
list: []
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.keyword) {
|
||||
this.keyword = option.keyword
|
||||
this.menu_index = 99
|
||||
}
|
||||
if (option.activity_id) {
|
||||
this.activity_id = option.activity_id
|
||||
this.menu_index = 99
|
||||
}
|
||||
if (option.manufacturer) {
|
||||
this.manufacturer = option.manufacturer
|
||||
this.menu_index = ''
|
||||
}
|
||||
if (option.cate_id) {
|
||||
this.cate_id = option.cate_id
|
||||
this.menu_index = ''
|
||||
}
|
||||
if (this.menu_index = 0) {
|
||||
this.keyword = ''
|
||||
}
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
},
|
||||
onShow() {
|
||||
this.car_GoodsNum = Config.shooppingCar_num
|
||||
},
|
||||
computed: {
|
||||
// 排序相关
|
||||
options() {
|
||||
let obj = this.screen.list[this.screen.currentIndex]
|
||||
let value = obj.status === 1 ? 1 : 0
|
||||
return {
|
||||
[obj.key]: value
|
||||
}
|
||||
},
|
||||
},
|
||||
// 搜索关键字
|
||||
onNavigationBarSearchInputChanged(e) {
|
||||
this.keyword = e.text
|
||||
},
|
||||
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance"
|
||||
onReachBottom() {
|
||||
if (this.isScroll) {
|
||||
uni.showNavigationBarLoading();
|
||||
this.getData();
|
||||
}
|
||||
|
||||
// setTimeout(() => {
|
||||
// uni.showNavigationBarLoading();
|
||||
// }, 500);
|
||||
|
||||
// this.getData();
|
||||
},
|
||||
//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
|
||||
// onPullDownRefresh() {
|
||||
// setTimeout(()=>{
|
||||
// uni.stopPullDownRefresh();
|
||||
// }, 1000);
|
||||
// },
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 选择菜单
|
||||
chooseMenu(index) {
|
||||
|
||||
|
||||
this.menu_index = index
|
||||
if(this.menu_index==0){
|
||||
this.sort_field = "default"
|
||||
}
|
||||
if(this.menu_index==1){
|
||||
this.is_saleClickMenu = true;
|
||||
this.is_priceClickMenu = false;
|
||||
this.sort_field = "sale"
|
||||
this.sale_menu_flag = !this.sale_menu_flag
|
||||
// 排序规则:0-升序,1-降序
|
||||
if(this.sale_menu_flag==true){
|
||||
this.sort_order = 0
|
||||
}else{
|
||||
this.sort_order = 1
|
||||
}
|
||||
}
|
||||
if(this.menu_index==2){
|
||||
this.is_priceClickMenu = true;
|
||||
this.is_saleClickMenu = false;
|
||||
this.sort_field = "price"
|
||||
this.price_menu_flag = !this.price_menu_flag
|
||||
// 排序规则:0-升序,1-降序
|
||||
if(this.price_menu_flag==true){
|
||||
this.sort_order = 0
|
||||
}else{
|
||||
this.sort_order = 1
|
||||
}
|
||||
}
|
||||
this.list = []
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
// this.activity_id = ''
|
||||
// this.keyword = ''
|
||||
|
||||
|
||||
},
|
||||
// 阻止时间冒泡 不要删除
|
||||
stop_click() {
|
||||
|
||||
},
|
||||
// removewored 清空输入框
|
||||
removewored() {
|
||||
this.keyword = ""
|
||||
this.flag = false;
|
||||
},
|
||||
|
||||
// 添加购物车
|
||||
async sure_btn() {
|
||||
if (this.goods_num <= 0) {
|
||||
uni.showToast({
|
||||
title: '请添加商品数量',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
if (this.is_pop_car.retail_flag == 0) { //零售
|
||||
if (this.goods_num % this.is_pop_car.retail_num !== 0) {
|
||||
uni.showToast({
|
||||
title: '该物品购买数量必须为包装的倍数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
this.car_GoodsNum += 1 // 需要修改
|
||||
let res = await X_goods.X_addCar(this.is_pop_car.sku_id, this.is_pop_car.batch_id, this.goods_num, '')
|
||||
if (res.code == 200 && res.data.errcode == 200) {
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
// this.uc_id = res;
|
||||
|
||||
if (res.code == 40000) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
} else { // 整售
|
||||
if (this.goods_num % this.is_pop_car.entirety_num !== 0) {
|
||||
|
||||
|
||||
uni.showToast({
|
||||
title: '该物品购买数量必须为包装的倍数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
this.car_GoodsNum += 1 // 需要修改
|
||||
let res = await X_goods.X_addCar(this.is_pop_car.sku_id, this.is_pop_car.batch_id, this.goods_num, '')
|
||||
if (res.code == 200 && res.data.errcode == 200) {
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
// this.uc_id = res;
|
||||
|
||||
if (res.message == 40000) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
to_car() {
|
||||
uni.switchTab({
|
||||
url: '/pages/shoppingCart/shoppingCart'
|
||||
});
|
||||
},
|
||||
imgError(e) {
|
||||
|
||||
},
|
||||
to_mes() {
|
||||
uni.navigateTo({
|
||||
url: '../my/is_message'
|
||||
})
|
||||
},
|
||||
// 返回键
|
||||
boback() {
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
// 关闭按钮
|
||||
cancel_popCar() {
|
||||
this.is_pop_show = false;
|
||||
},
|
||||
//减 商品的数量
|
||||
reduse_goodsNum() {
|
||||
if (this.is_pop_car.retail_flag == 0) { //零售
|
||||
this.goods_num = this.goods_num - this.is_pop_car.retail_num
|
||||
} else { // 整售
|
||||
this.goods_num = this.goods_num - this.is_pop_car.entirety_num
|
||||
}
|
||||
|
||||
|
||||
if (this.goods_num <= 0) {
|
||||
this.goods_num = 0
|
||||
uni.showToast({
|
||||
title: '商品数量不得为负',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
// 增加 商品的数量
|
||||
async add_goodsNum() {
|
||||
if (this.goods_num == this.is_pop_car.stock_num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
if (this.is_pop_car.retail_flag == 0) { //零售
|
||||
this.goods_num = Number(this.goods_num) + Number(this.is_pop_car.retail_num)
|
||||
} else { // 整售
|
||||
this.goods_num = Number(this.goods_num) + Number(this.is_pop_car.entirety_num)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 加入购物车
|
||||
async toAdd_car(item) {
|
||||
this.is_pop_car = item
|
||||
console.log(this.is_pop_car)
|
||||
this.is_pop_show = true;
|
||||
|
||||
if (item.retail_flag == 0) { //零售
|
||||
this.goods_num = item.retail_num
|
||||
} else { // 整售
|
||||
this.goods_num = item.entirety_num
|
||||
}
|
||||
|
||||
},
|
||||
// 进入详情页
|
||||
goodsDetail(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/shoppingCart/goodsDetail?sku_id=' + item.sku_id
|
||||
});
|
||||
},
|
||||
// 加载数据
|
||||
async getData() {
|
||||
this.data_text = '数据加载中...'
|
||||
let res = await X_goods.search(
|
||||
this.keyword, // 关键字
|
||||
this.cate_id, //分类id
|
||||
this.activity_id, // 活动id
|
||||
this.retail_flag, //零整标志:0-零售,1-整件售 允许值: 0, 1
|
||||
this.sort_field, //排序字段"default", "sale", "price", "term_validity"
|
||||
this.sort_order, // //排序规则 :0-升序,1-降序
|
||||
this.term_validity, //
|
||||
this.drug_form,
|
||||
this.manufacturer, // 生产厂家
|
||||
this.price_start, //开始价格
|
||||
this.price_end, // 结束价格
|
||||
this.current_page // 分页 页
|
||||
)
|
||||
if (res.data.data.current_page == res.data.data.last_page) {
|
||||
this.isScroll = false
|
||||
uni.hideNavigationBarLoading();
|
||||
// uni.showToast({
|
||||
// title: '到底了',
|
||||
// duration: 1000,
|
||||
// icon: 'none'
|
||||
// });
|
||||
// this.loadingText="到底了";
|
||||
}
|
||||
if (res.data.data.data.length <= 0) {
|
||||
this.data_text = '暂无数据'
|
||||
}
|
||||
for (let i = 0; i < res.data.data.data.length; i++) {
|
||||
this.list.push(res.data.data.data[i])
|
||||
}
|
||||
this.current_page++
|
||||
uni.hideNavigationBarLoading();
|
||||
this.handleError(res, res => {
|
||||
|
||||
// this.label2.list = res.data.to_select.manufacturer //生产厂家
|
||||
// this.label3.list = res.data.to_select.drug_form //剂型
|
||||
// this.label4.list = res.data.to_select.retail_flag //售卖
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 初始化搜索
|
||||
initSearch() {
|
||||
this.label.selected = 0
|
||||
this.condition = {}
|
||||
this.current_page = 1
|
||||
this.list = []
|
||||
},
|
||||
// 搜索联动
|
||||
async the_searchList() {
|
||||
let res = await X_goods.x_searchList(this.keyword)
|
||||
this.search_liandong = res.data
|
||||
this.handleError(res, res => {})
|
||||
},
|
||||
// 搜索
|
||||
to_choose(item) {
|
||||
this.list = []
|
||||
this.keyword = item.name
|
||||
// this.manufacturer = item.manufacturer_name
|
||||
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
this.flag = false
|
||||
},
|
||||
// 搜索 监听input框的值
|
||||
changeInput(event) {
|
||||
this.keyword = event.detail.value
|
||||
this.manufacturer = ''
|
||||
if (event.detail.value == '') {
|
||||
this.flag = false
|
||||
this.list = []
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
} else {
|
||||
this.flag = true
|
||||
this.the_searchList();
|
||||
}
|
||||
},
|
||||
search() {
|
||||
this.isScroll = true;
|
||||
this.manufacturer = ''
|
||||
this.flag = false;
|
||||
uni.hideKeyboard();
|
||||
if (this.keyword === '') {
|
||||
uni.showToast({
|
||||
title: '关键词不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.list = []
|
||||
this.current_page = 1
|
||||
this.getData();
|
||||
uni.hideKeyboard()
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place {
|
||||
background-color: #ffffff;
|
||||
height: 258upx;
|
||||
}
|
||||
|
||||
.uni-app {
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
,
|
||||
.uni-page-wrapper {
|
||||
display: block;
|
||||
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.uni-page {}
|
||||
|
||||
.some_txt {
|
||||
width: 300upx;
|
||||
overflow: hidden;
|
||||
/*隐藏溢出*/
|
||||
text-overflow: ellipsis;
|
||||
/*当文本溢出包含元素时显示省略符号来代表被修剪的文本*/
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
uni-page-body {
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
.contant {
|
||||
height: auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.topfind {
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.is_top {
|
||||
height: 168upx;
|
||||
padding-top: 90upx;
|
||||
|
||||
.top_info {
|
||||
|
||||
height: 60upx;
|
||||
|
||||
position: relative;
|
||||
|
||||
|
||||
|
||||
.is_top_search {
|
||||
|
||||
border-radius: 50upx;
|
||||
position: relative;
|
||||
|
||||
.search_liandong {
|
||||
max-height: 750upx;
|
||||
overflow-y: auto;
|
||||
font-size: 20upx;
|
||||
color: #989898;
|
||||
width: 100%;
|
||||
margin-top: 2upx;
|
||||
|
||||
line-height: 80upx;
|
||||
z-index: 101;
|
||||
position: fixed;
|
||||
right: 0upx;
|
||||
|
||||
.search_items {
|
||||
margin-top: 2upx;
|
||||
padding: 0 30upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
}
|
||||
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 40upx;
|
||||
top: 20upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
|
||||
}
|
||||
|
||||
.closeicon {
|
||||
width: 40upx;
|
||||
height: 40upx;
|
||||
position: absolute;
|
||||
top: 10upx;
|
||||
right: 10upx;
|
||||
}
|
||||
|
||||
.search_input {
|
||||
margin-left: 50upx;
|
||||
color: #989898;
|
||||
line-height: 60upx;
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
height: 60upx;
|
||||
width: 70upx;
|
||||
}
|
||||
|
||||
.car_GoodsNum {
|
||||
background-color: #EB5159;
|
||||
color: #FFFFFF;
|
||||
position: absolute;
|
||||
top: -6upx;
|
||||
right: -18upx;
|
||||
height: 40upx;
|
||||
width: 40upx;
|
||||
line-height: 40upx;
|
||||
font-size: 20upx;
|
||||
border-radius: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list_menu {
|
||||
height: 90upx;
|
||||
width: 100%;
|
||||
line-height: 90upx;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
background-color: #FFFFFF;
|
||||
.paixu{
|
||||
height:29upx;
|
||||
margin-left:8upx;
|
||||
width:14upx;
|
||||
}
|
||||
.active_menu {
|
||||
color: #6E67FF;
|
||||
border-bottom: 4upx solid #6E67FF;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.no_img {
|
||||
height: 198upx;
|
||||
width: 294px;
|
||||
margin: 90upx auto;
|
||||
}
|
||||
|
||||
.list {
|
||||
height: calc(100% - 258upx);
|
||||
overflow-y: auto;
|
||||
z-index: 99;
|
||||
|
||||
.loading-world {
|
||||
text-align: center;
|
||||
color:#515151;
|
||||
font-size: 24upx;
|
||||
.loading-img{
|
||||
width:28upx;
|
||||
height:28upx;
|
||||
}
|
||||
}
|
||||
|
||||
.list_items {
|
||||
padding: 30upx 0;
|
||||
border-radius: 20upx;
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
// width: 270upx;
|
||||
width:35%;
|
||||
padding: 10upx;
|
||||
margin: 0 10upx;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
position: relative;
|
||||
|
||||
.goods_count {
|
||||
position: absolute;
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
|
||||
.x_car {
|
||||
position: absolute;
|
||||
right: 50upx;
|
||||
bottom: 0upx;
|
||||
height: 50upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.car_pop {
|
||||
overflow: hidden;
|
||||
position: fixed;
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
.pop_box {
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
bottom: 0%;
|
||||
// height:707upx;
|
||||
border-radius: 10upx 10upx 0 0;
|
||||
|
||||
.cancel_pop {
|
||||
height: 38upx;
|
||||
width: 38upx;
|
||||
position: absolute;
|
||||
right: 30upx;
|
||||
top: 30upx;
|
||||
}
|
||||
|
||||
.pop_goods_info {
|
||||
height: 267upx;
|
||||
border-bottom: 5upx dashed #989898;
|
||||
|
||||
.pop_box_img {
|
||||
.pop_img {
|
||||
margin-right: 60upx;
|
||||
vertical-align: middle;
|
||||
height: 142upx;
|
||||
width: 200upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.address {
|
||||
padding: 20upx 30upx;
|
||||
border-bottom: 4upx solid #F2F2F2;
|
||||
|
||||
.dizhi_img {
|
||||
margin-right: 30upx;
|
||||
height: 27upx;
|
||||
width: 20upx;
|
||||
}
|
||||
|
||||
.pop_right {
|
||||
height: 22upx;
|
||||
width: 13upx;
|
||||
|
||||
}
|
||||
|
||||
.goods_count {
|
||||
// position: absolute;
|
||||
// bottom: -14upx;
|
||||
// right: 8upx;
|
||||
}
|
||||
}
|
||||
|
||||
.pop_sure {
|
||||
line-height: 82upx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.radio-active {
|
||||
background: #FCE0D5 !important;
|
||||
color: #EB7320 !important;
|
||||
border-color: #EB7320 !important;
|
||||
;
|
||||
}
|
||||
|
||||
.tui-drawer-content {
|
||||
padding: 16rpx 30rpx 30rpx 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tui-input {
|
||||
border: 0;
|
||||
height: 64rpx;
|
||||
border-radius: 32rpx;
|
||||
width: 45%;
|
||||
background: #f7f7f7;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
}
|
||||
</style>
|
||||
278
金壶/appV1/pages/home/search.vue
Normal file
278
金壶/appV1/pages/home/search.vue
Normal file
@@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class='bg-linear-gradient is_top d-flex'>
|
||||
<view class="top_info w-90 x_margin0auto d-flex j-sb a-center">
|
||||
<image src="../../static/my/left.png" mode="" style="height:30upx; width:19upx;" @click="goback()"></image>
|
||||
<view class="is_top_search x-bg-white h-100 flex-1 margin-zy20">
|
||||
<image src="../../static/home/search.png" mode="" class="search_img" @click="search()" ></image>
|
||||
<!-- <input type="text" value="" placeholder="搜索" class="search_input h-100" v-model="keyword" /> -->
|
||||
<input type="text" v-model="keyword" @input="changeInput($event)" confirm-type="search" focus="" @confirm="search" placeholder="请输入药名/厂家" class="search_input h-100"/>
|
||||
<image class="closeicon" v-if="keyword!=''" @click="removewored()" src="../../static/shoppingCart/cancel.png" mode=""></image>
|
||||
<view class="search_liandong bg_F2F2F2 shadow" v-if='flag==true'>
|
||||
<view class="border-bottom x-bg-white search_items" v-for='(item,index) in search_liandong' :key='index' @tap='chooseSearch(item)'>{{item.name}}({{item.manufacturer_name}})</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<image src="../../static/my/message.png" mode="" class="message" @click="to_mes()"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="font-weight font_28 margin-zy20" style="line-height: 90upx;">热门搜索</view>
|
||||
<view class="list d-flex flex-wrap" >
|
||||
<view class="padding-zy30 list_item" v-for="(item,index) in hot" :key="index" @click="choose(item)">{{item.name}}</view>
|
||||
</view>
|
||||
|
||||
<!-- <card headTitle="搜索记录">
|
||||
<view slot="right" class="font text-danger"
|
||||
@click="clearHistory">清除</view>
|
||||
<uni-list-item v-for="(item,index) in historyList" :key="index"
|
||||
:title="item" :showArrow="false" @click="quickSearch(item)"></uni-list-item>
|
||||
</card> -->
|
||||
<!-- <view class="font text-primary ml-2" @click="clearHistory">清除搜索记录</view> -->
|
||||
<!-- 分割线 -->
|
||||
|
||||
<!-- <card headTitle="热门搜索">
|
||||
|
||||
<view class="px-1 mb-2">
|
||||
<color-tag v-for="(item,index) in hot" :key="index" :item="item" @click.native="hotSearch(item.name)"></color-tag>
|
||||
</view>
|
||||
</card> -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import tuiIcon from "@/components/icon/icon"
|
||||
import card from "@/components/common/card.vue"
|
||||
import colorTag from "@/components/search/color-tag.vue"
|
||||
import uniListItem from "@/components/uni-ui/uni-list-item/uni-list-item.vue"
|
||||
export default {
|
||||
components:{
|
||||
card,
|
||||
colorTag,
|
||||
uniListItem,
|
||||
tuiIcon,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
review:true,
|
||||
historyList:[],
|
||||
keyword:"",
|
||||
hot:[],
|
||||
cate:[],
|
||||
search_liandong:'',// // 搜索联动
|
||||
is_key:'',
|
||||
flag:false,
|
||||
manufacturer_name:'' //厂家
|
||||
}
|
||||
},
|
||||
onNavigationBarButtonTap(e) {
|
||||
if (e.index === 0) {
|
||||
uni.navigateTo({
|
||||
url: 'search-list',
|
||||
});
|
||||
}
|
||||
},
|
||||
// onNavigationBarSearchInputChanged(e) {
|
||||
// this.keyword = e.text
|
||||
// },
|
||||
// onNavigationBarSearchInputConfirmed() {
|
||||
// this.search()
|
||||
// },
|
||||
// onNavigationBarButtonTap() {
|
||||
// this.search()
|
||||
// },
|
||||
watch: {
|
||||
'$route'(to, from) {
|
||||
if(to.path == '/pages/home/search' && from.path != '/pages/home/search-list'){
|
||||
this.hotSearch()
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
this.hotSearch()
|
||||
},
|
||||
methods: {
|
||||
// removewored 清空输入框
|
||||
removewored(){
|
||||
this.keyword = ""
|
||||
this.flag = false
|
||||
},
|
||||
// x_searchList
|
||||
// 搜索联动列表
|
||||
async the_searchList(){
|
||||
let res = await X_goods.x_searchList(this.is_key)
|
||||
this.search_liandong = res.data
|
||||
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 监听搜索框的值
|
||||
changeInput(event){
|
||||
if(event.detail.value==''){
|
||||
this.flag = false
|
||||
}else{
|
||||
this.flag = true
|
||||
this.is_key = event.detail.value
|
||||
|
||||
this.the_searchList();
|
||||
}
|
||||
},
|
||||
// 返回键
|
||||
goback(){
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
//
|
||||
chooseSearch(item){
|
||||
this.flag = false
|
||||
uni.navigateTo({
|
||||
url:'./search-list?keyword='+item.name +'&manufacturer='+item.manufacturer_name
|
||||
})
|
||||
},
|
||||
//choose
|
||||
choose(item){
|
||||
uni.navigateTo({
|
||||
url:'./search-list?keyword='+item.name
|
||||
})
|
||||
},
|
||||
to_mes(){
|
||||
uni.navigateTo({
|
||||
url:'../my/is_message'
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
search() {
|
||||
if (this.keyword === '') {
|
||||
uni.showToast({
|
||||
title: '关键词不能为空',
|
||||
icon: 'none'
|
||||
});
|
||||
}else{
|
||||
|
||||
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'search-list?keyword='+this.keyword
|
||||
});
|
||||
uni.hideKeyboard()
|
||||
return
|
||||
|
||||
// indexOf -1 没匹配到; 1 匹配到
|
||||
// console.log(this.keyword.indexOf(" ") != -1 );
|
||||
return
|
||||
if (this.keyword.indexOf(" ") == -1) {
|
||||
// console.log("没有空格")
|
||||
} else {
|
||||
// console.log("空格")
|
||||
// let str = ‘被测对象(人)>被测对象属性(心跳)>三轴振动传感器’
|
||||
let index = this.keyword .lastIndexOf(" ")
|
||||
this.keyword =this.keyword .substring(0,index);
|
||||
// console.log(this.keyword,'截取前') //被测对象(人)>被测对象属性(心跳)
|
||||
// console.log(this.keyword.length,'截取前length') //被测对象(人)>被测对象属性(心跳)
|
||||
|
||||
let index1 = this.keyword .lastIndexOf(" ")
|
||||
this.manufacturer_name =this.keyword .substring(index1+1,this.keyword.length);
|
||||
// console.log(this.manufacturer_name) //三轴振动传感器
|
||||
if(this.keyword.length<=0){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// this.the_searchList(); // 大佬
|
||||
// 超
|
||||
uni.navigateTo({
|
||||
url: 'search-list?keyword='+this.keyword
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
async hotSearch(e){
|
||||
let res = await X_goods.goodsRanking()
|
||||
this.handleError(res, res => {
|
||||
this.hot = res.data
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.uni-input-placeholder{
|
||||
|
||||
line-height: 168upx;
|
||||
}
|
||||
.is_top {
|
||||
height: 168upx;
|
||||
padding-top: 90upx;
|
||||
|
||||
.top_info {
|
||||
height: 60upx;
|
||||
|
||||
position: relative;
|
||||
.is_top_search {
|
||||
|
||||
line-height: 27upx;
|
||||
border-radius: 50upx;
|
||||
position: relative;
|
||||
.search_liandong{
|
||||
max-height: 750upx;
|
||||
overflow-y: auto;
|
||||
font-size: 20upx;
|
||||
color:#989898;
|
||||
width:100%;
|
||||
margin-top:20upx;
|
||||
line-height: 80upx;
|
||||
position: fixed;
|
||||
left:0;
|
||||
right:0upx;
|
||||
.search_items{
|
||||
margin-top: 2upx;
|
||||
padding:0 30upx;
|
||||
overflow:hidden;
|
||||
|
||||
text-overflow:ellipsis;
|
||||
|
||||
white-space:nowrap;
|
||||
}
|
||||
}
|
||||
.search_img {
|
||||
position: absolute;
|
||||
left: 60upx;
|
||||
top: 20upx;
|
||||
height: 27upx;
|
||||
width: 27upx;
|
||||
}
|
||||
.closeicon{
|
||||
width:40upx;
|
||||
height: 40upx;
|
||||
position: absolute;
|
||||
top:10upx;
|
||||
right: 10upx;
|
||||
}
|
||||
.search_input {
|
||||
margin-left: 70upx;
|
||||
width: 70%;
|
||||
font-size: 25upx;
|
||||
color: #989898;
|
||||
line-height: 27upx;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
margin-left: 20upx;
|
||||
height: 43upx;
|
||||
width: 50upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.list_item{
|
||||
margin:10upx;
|
||||
color:#989898;
|
||||
}
|
||||
</style>
|
||||
50
金壶/appV1/pages/home/shop_management.vue
Normal file
50
金壶/appV1/pages/home/shop_management.vue
Normal file
@@ -0,0 +1,50 @@
|
||||
<template>
|
||||
<view class="shop_management">
|
||||
很好
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {Config} from "@/utils/config.js"
|
||||
//import shop from "@/utils/models/shop.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shopInfo: [],
|
||||
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
//this.get_shopInfo()
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 退出登录
|
||||
login_out(){
|
||||
// 清除config的token
|
||||
Config.Authorization = ''
|
||||
// 清除缓存
|
||||
uni.clearStorage()
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/index/x_login'
|
||||
// })
|
||||
},
|
||||
//获取店铺详情
|
||||
// async get_shopInfo() {
|
||||
// let res = await shop.getIndexShopInfo()
|
||||
// this.handleError(res, res => {
|
||||
// this.shopInfo = res.data
|
||||
// Config.shop_currency = res.data.currency
|
||||
// })
|
||||
// },
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
1
金壶/appV1/pages/my/.pydio
Normal file
1
金壶/appV1/pages/my/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
c277717d-6d81-4989-92ed-425db9fd8ef7
|
||||
27
金壶/appV1/pages/my/AboutUs.vue
Normal file
27
金壶/appV1/pages/my/AboutUs.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div class="content">
|
||||
<HeaderTop page_title='关于我们'></HeaderTop>
|
||||
<view class="padding-30">
|
||||
<h2>测试</h2>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
export default {
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
</style>
|
||||
66
金壶/appV1/pages/my/authentication.vue
Normal file
66
金壶/appV1/pages/my/authentication.vue
Normal file
@@ -0,0 +1,66 @@
|
||||
<template>
|
||||
<!-- 认证1 页面 -->
|
||||
<view class="content"></view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
get_code: false,
|
||||
count_time: 60,
|
||||
phone: '',
|
||||
code: '',
|
||||
new_password: '',
|
||||
sure_password: '',
|
||||
}
|
||||
},
|
||||
// 跳过按钮的回调函数
|
||||
onNavigationBarButtonTap(e) {
|
||||
|
||||
},
|
||||
methods: {
|
||||
// 获取验证码
|
||||
getCode() {
|
||||
this.get_code = !this.get_code
|
||||
this.timer();
|
||||
},
|
||||
// 验证码计时器
|
||||
timer() {
|
||||
if (this.count_time > 0) {
|
||||
this.count_time--;
|
||||
this.get_code = true
|
||||
setTimeout(this.timer, 1000);
|
||||
} else {
|
||||
this.count_time = 60;
|
||||
this.get_code = false
|
||||
|
||||
}
|
||||
},
|
||||
sure() {
|
||||
verification.isNull(this.phone, this.code, this.new_password, this.sure_password) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
verification.isPhone(this.phone); // 手机号格式验证
|
||||
}
|
||||
if (verification.isPhone.prototype.the_isPhone == true) {
|
||||
verification.isSamePsd(this.new_password, this.sure_password); // 两次密码是否相同
|
||||
}
|
||||
|
||||
if (
|
||||
verification.isNull.prototype.the_Null == true &&
|
||||
verification.isPhone.prototype.the_isPhone == true &&
|
||||
verification.isSamePsd.prototype.the_isSamePsd == true
|
||||
) {
|
||||
uni.navigateTo({
|
||||
url: 'authentication'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
77
金壶/appV1/pages/my/bind_phone.vue
Normal file
77
金壶/appV1/pages/my/bind_phone.vue
Normal file
@@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<!-- 绑定手机号 页面 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='绑定手机号'></HeaderTop>
|
||||
<view class="padding-30">
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto padding-zy30 j-sb a-center border-bottom list">
|
||||
<input class="uni-input h-100 flex-1" type="number" focus placeholder="请输入手机号" v-model="phone"/>
|
||||
<view class="get_code x-text-red x-text-font24" v-if="get_code==false" @click="getCode()">获取验证码</view>
|
||||
<view class="get_code x-text-red x-text-font24 w-50" v-else>{{count_time}}s后再次获取验证码</view>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto padding-zy30 j-sb a-center border-bottom list">
|
||||
<input class="uni-input flex-1" type="number" placeholder="验证码" v-model="code" />
|
||||
</view>
|
||||
<view class="x_public_box x-bg-159 esc_login x-text-white" @click="sureBind()">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
phone:'',
|
||||
get_code: false, //判断是否点击了“获取验证码”按钮 是:true ; 否:false
|
||||
code: '', // 验证码
|
||||
count_time: 60,
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
methods:{
|
||||
// 确认绑定手机号
|
||||
sureBind(){
|
||||
verification.isNull(this.phone, this.code) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
uni.navigateBack(2)
|
||||
|
||||
}
|
||||
},
|
||||
// 获取验证码
|
||||
getCode() {
|
||||
this.get_code = !this.get_code
|
||||
this.timer();
|
||||
},
|
||||
// 验证码计时器
|
||||
timer() {
|
||||
if (this.count_time > 0) {
|
||||
this.count_time--;
|
||||
this.get_code = true
|
||||
setTimeout(this.timer, 1000);
|
||||
} else {
|
||||
this.count_time = 60;
|
||||
this.get_code = false
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
position: relative;
|
||||
.list{
|
||||
height: 83upx;
|
||||
}
|
||||
.esc_login{
|
||||
line-height: 82upx;
|
||||
position: absolute;
|
||||
bottom:100upx;
|
||||
left: 34upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
107
金壶/appV1/pages/my/change_password.vue
Normal file
107
金壶/appV1/pages/my/change_password.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<!-- 修改密码 页面 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='修改密码'></HeaderTop>
|
||||
<view class="padding-30">
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list">
|
||||
<view class="">旧密码</view>
|
||||
<input type="password" value="" placeholder="请输入旧密码" class="flex-1" v-if="is_seenOld==false" v-model="old_password"/>
|
||||
<input type="text" value="" placeholder="请输入旧密码" class="flex-1" v-if="is_seenOld==true" v-model="old_password"/>
|
||||
<image src="../../static/my/bukan.png" mode="" class="bukan" v-if="is_seenOld==false" @click="isChangeOld()"></image>
|
||||
<image src="../../static/my/kan.png" mode="" class="kan" v-if="is_seenOld==true" @click="isChangeOld()"></image>
|
||||
</view>
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list">
|
||||
<view class="">新密码</view>
|
||||
<input type="password" value="" placeholder="请输入新密码" class="flex-1" v-if="is_seenNew==false" v-model="new_password"/>
|
||||
<input type="text" value="" placeholder="请输入新密码" class="flex-1" v-if="is_seenNew==true" v-model="new_password"/>
|
||||
<image src="../../static/my/bukan.png" mode="" class="bukan" v-if="is_seenNew==false" @click="isChangeNew()"></image>
|
||||
<image src="../../static/my/kan.png" mode="" class="kan" v-if="is_seenNew==true" @click="isChangeNew()"></image>
|
||||
</view>
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list">
|
||||
<view class="">确认密码</view>
|
||||
<input type="password" value="" placeholder="请输入新密码" class="flex-1" ref='sure_pass' v-if="is_seenSure==false" v-model="sure_password"/>
|
||||
<input type="text" value="" placeholder="请输入新密码" class="flex-1" ref='sure_pass' v-if="is_seenSure==true" v-model="sure_password"/>
|
||||
<image src="../../static/my/bukan.png" mode="" class="bukan" v-if="is_seenSure==false" @click="isChangeSure()"></image>
|
||||
<image src="../../static/my/kan.png" mode="" class="kan" v-if="is_seenSure==true" @click="isChangeSure()"></image>
|
||||
</view>
|
||||
<view class="x_public_box x-bg-159 esc_login x-text-white w-90" @click="surePassword()">确定</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_login from '../../utils/models/x_login.js'
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
old_password:'', //旧密码
|
||||
new_password:'', //新密码
|
||||
sure_password:'', //确认密码
|
||||
is_seenOld:false,
|
||||
is_seenNew:false,
|
||||
is_seenSure:false
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
methods:{
|
||||
isChangeOld(){
|
||||
this.is_seenOld = ! this.is_seenOld
|
||||
},
|
||||
isChangeNew(){
|
||||
this.is_seenNew = ! this.is_seenNew
|
||||
},
|
||||
isChangeSure(){
|
||||
this.is_seenSure = ! this.is_seenSure
|
||||
},
|
||||
// 确认修改密码
|
||||
async surePassword(){
|
||||
verification.isNull(this.old_password, this.new_password, this.sure_password) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
verification.isSamePsd(this.new_password,this.sure_password); // 两次密码是否相同
|
||||
}
|
||||
|
||||
if (
|
||||
verification.isNull.prototype.the_Null == true &&
|
||||
verification.isSamePsd.prototype.the_isSamePsd == true
|
||||
) {
|
||||
let res = await X_login.X_editphone(this.old_password,this.new_password)
|
||||
uni.clearStorage();
|
||||
uni.redirectTo({
|
||||
url:'./x_login'
|
||||
})
|
||||
this.handleError(res, res => {
|
||||
this.list = res.data
|
||||
})
|
||||
// uni.navigateBack(2)
|
||||
// console.log('修改成功');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
position: relative;
|
||||
.list{
|
||||
height: 83upx;
|
||||
.bukan{
|
||||
height:15upx;
|
||||
width:47upx;
|
||||
}
|
||||
.kan{
|
||||
height:36upx;
|
||||
width:47upx;
|
||||
}
|
||||
}
|
||||
.esc_login{
|
||||
line-height: 82upx;
|
||||
margin-top:200upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
320
金壶/appV1/pages/my/collect.vue
Normal file
320
金壶/appV1/pages/my/collect.vue
Normal file
@@ -0,0 +1,320 @@
|
||||
<template>
|
||||
<!-- 购物车 页面 -->
|
||||
<view class="content w-100 h-100">
|
||||
<!-- <view>
|
||||
<image src="../../static/font/search.png" mode=""></image>
|
||||
</view> -->
|
||||
<view class="header bg-linear-gradient x-text-white text-center">
|
||||
<image src="../../static/my/left.png" mode="" class="goback" @click="back()"></image>
|
||||
收藏商品
|
||||
<view class="search">
|
||||
<!-- <image src="../../static/font/search.png" mode=""></image> -->
|
||||
</view>
|
||||
<view class="edit_shoppingCar" @click="edit_shoppingCar()" v-if="isEdit==true">完成</view>
|
||||
<view class="edit_shoppingCar" @click="edit_shoppingCar()" v-if="isEdit==false &&list.length>0">编辑</view>
|
||||
</view>
|
||||
<view class="list" v-if="list.length>0">
|
||||
<view class="list_items" v-for="(item,index) in list" :key="index">
|
||||
<checkbox-group class="block" style='padding:0 30upx 30upx'>
|
||||
<view class=" d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<checkbox-group @change="selected(item)" v-if="isEdit==true">
|
||||
<checkbox class="xuanzhong" :checked="item.checked" />
|
||||
</checkbox-group>
|
||||
<view class="box_img" @click="goodsDetail(item)">
|
||||
<image :src="'https://'+item.pc_thumb" mode="" class="h-100 w-100"></image>
|
||||
</view>
|
||||
<view class="goods_txt flex-1" @click="goodsDetail(item)">
|
||||
<view class="font-weight">{{item.name}}</view>
|
||||
<view class="">{{item.factory_name}}</view>
|
||||
<view class="">{{item.spec_desc}}</view>
|
||||
<view class="x-text-159">{{item.show_price}}</view>
|
||||
</view>
|
||||
<!-- <view class="goods_count d-flex">
|
||||
<view class="bianji_cars_num bianji_cars_numJian" @click="reduse_goodsNum(index)">-</view>
|
||||
<view class="bianji_cars_num bianji_cars_numAdd">{{goods_num}}</view>
|
||||
<view class="bianji_cars_num bianji_cars_numAdd" @click="add_goodsNum(index)">+</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<!-- <view class="settlement shadow d-flex a-center" v-if="isEdit==true">
|
||||
|
||||
</view> -->
|
||||
<view class="settlement shadow d-flex a-center" v-if="isEdit==true">
|
||||
<view class="all_choose">
|
||||
<checkbox-group @change="selectedall()">
|
||||
<checkbox class="quanxuananniu" :checked="allchecked" />全选
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="x_textRight flex-1 d-flex text-right ml-5">
|
||||
<view>已选:</view>
|
||||
<view class="x-text-159"> {{jianshu}} </view>
|
||||
<view>件</view>
|
||||
</view>
|
||||
<view class="x-bg-159 text-center del_goods bg-danger text-white" @click="del_goods()">删除</view>
|
||||
</view>
|
||||
<view class="no_list x_margin0auto" v-if="list.length<=0">
|
||||
<image src="../../static/shoppingCart/nopic.png" mode="" class="no_list_img"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
// import {Config} from '@/utils/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
allchecked: false, //默认全选为true,因为后台数据没有是否选中的信息
|
||||
goods_num: 10, //商品当前数量
|
||||
Stock: 20, //当前商品的总库存
|
||||
isEdit: false, // 判断是否编辑购物车,true为编辑,false为不编辑
|
||||
add_choose_checked: false,
|
||||
list: [], // 数据
|
||||
|
||||
isChecked: false,
|
||||
checkboxData: [{
|
||||
'value': 0,
|
||||
'label': '选项一'
|
||||
}, {
|
||||
'value': 1,
|
||||
'label': '选项2'
|
||||
}],
|
||||
checkedArr: [], //复选框选中的值
|
||||
allChecked: false, //是否全选
|
||||
jianshu: 0, // 已选中的件数
|
||||
goods_id: '',
|
||||
goodsId_arr:[],
|
||||
id: {}
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.collectList();
|
||||
},
|
||||
methods: {
|
||||
// 删除收藏的商品
|
||||
async del_goods() {
|
||||
var newArr = this.list.filter(function(obj) {
|
||||
return obj.checked == true;
|
||||
});
|
||||
newArr.map((item,index)=>{
|
||||
this.goods_id += item.goods_id+','
|
||||
this.goodsId_arr.push({"goods_id":item.goods_id})
|
||||
});
|
||||
|
||||
//this.goods_id = this.goods_id.substr(0, this.goods_id.length - 1);
|
||||
// let res = await X_goods.X_addCollect_app(JSON.stringify(this.goodsId_arr), 2)
|
||||
let res = await X_goods.X_addCollect_app(this.goods_id, 2)
|
||||
this.handleError(res, res => {
|
||||
|
||||
this.isEdit = false
|
||||
this.collectList();
|
||||
})
|
||||
},
|
||||
// 单个商品前的勾选
|
||||
selected(item) {
|
||||
|
||||
item.checked = !item.checked
|
||||
|
||||
if (!item.checked) {
|
||||
this.allchecked = false
|
||||
this.jianshu--
|
||||
} else {
|
||||
this.jianshu++
|
||||
const test = this.list.every(item => {
|
||||
return item.checked === true
|
||||
})
|
||||
if (test) {
|
||||
this.allchecked = true
|
||||
} else {
|
||||
this.allchecked = false
|
||||
}
|
||||
}
|
||||
},
|
||||
// 全选按钮
|
||||
selectedall() {
|
||||
this.allchecked = !this.allchecked;
|
||||
this.jianshu = 0;
|
||||
|
||||
if (this.allchecked) {
|
||||
this.list.map(item => {
|
||||
item.checked = true
|
||||
})
|
||||
|
||||
this.jianshu = this.jianshu + this.list.length
|
||||
|
||||
} else {
|
||||
this.list.map(item => {
|
||||
item.checked = false
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
// 商品收藏列表
|
||||
async collectList() {
|
||||
|
||||
let res = await X_goods.x_Collectlsit()
|
||||
this.handleError(res, res => {
|
||||
|
||||
this.list = res.data.data.list
|
||||
|
||||
this.list.map(item => {
|
||||
item.checked = false
|
||||
})
|
||||
})
|
||||
},
|
||||
//去结算
|
||||
to_pay() {
|
||||
uni.navigateTo({
|
||||
url: './sureOrder'
|
||||
})
|
||||
},
|
||||
// 管理购物车
|
||||
edit_shoppingCar() {
|
||||
this.isEdit = !this.isEdit
|
||||
},
|
||||
// 进入商品详情页
|
||||
goodsDetail(item) {
|
||||
console.log(item,2)
|
||||
if (this.isEdit == false) {
|
||||
uni.navigateTo({
|
||||
url:'../home/search-list?keyword='+item.name
|
||||
})
|
||||
}
|
||||
},
|
||||
back(){
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
// 登录
|
||||
to_login() {
|
||||
uni.navigateTo({
|
||||
url: 'x_login'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
.goback{
|
||||
position: absolute;
|
||||
bottom:29upx;
|
||||
left:31upx;
|
||||
height:30.9upx;
|
||||
width:18upx;
|
||||
}
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
height: calc(100% - 248upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.list_items {
|
||||
|
||||
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 270upx;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
position: relative;
|
||||
|
||||
.goods_count {
|
||||
position: absolute;
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no_list {
|
||||
margin-top: 315upx;
|
||||
text-align: center;
|
||||
|
||||
.no_list_img {
|
||||
height: 198upx;
|
||||
width: 395upx;
|
||||
}
|
||||
}
|
||||
|
||||
.settlement {
|
||||
height: 100upx;
|
||||
.all_choose {
|
||||
width: 30%;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
|
||||
.to_buy {
|
||||
line-height: 100upx;
|
||||
width: 260upx;
|
||||
min-width: 224.6upx;
|
||||
font-size: 34upx;
|
||||
}
|
||||
|
||||
.add_toCollection {
|
||||
border: 1upx solid #EDCA4A;
|
||||
border-radius: 30upx;
|
||||
|
||||
line-height: 60upx;
|
||||
width: 198.8upx;
|
||||
color: #EDCA4A;
|
||||
margin: 0 22px 0 30px;
|
||||
}
|
||||
|
||||
.del_goods {
|
||||
border: 1upx solid #EB5159;
|
||||
// border-radius: 30upx;
|
||||
width: 249.6upx;
|
||||
height: 100upx;
|
||||
line-height: 100upx;
|
||||
color: #EB5159;
|
||||
border: 1upx solid #EB5159;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
// .search{
|
||||
// border: 1rpx solid #007AFF;
|
||||
// width: 40.9upx;height: 40.9upx;
|
||||
// position: absolute;
|
||||
// bottom: -48upx;
|
||||
// right: 150upx;
|
||||
// }
|
||||
}
|
||||
</style>
|
||||
76
金壶/appV1/pages/my/explain.vue
Normal file
76
金壶/appV1/pages/my/explain.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<!-- 《医点医滴会员服务协议》 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='医点医滴会员服务协议'></HeaderTop>
|
||||
<view class="padding-30">
|
||||
<view class="font-weight font_28">《医点医滴会员服务协议》</view>
|
||||
<view class="">欢迎使用医点医滴平台(以下简称"平台")。为维护市场交易秩序,平台与会员(指采购商会员)达成以下服务协议:</view>
|
||||
<view class="font-weight">一、遵守法律法规</view>
|
||||
<view>采购商会员使用平台进行药品交易,其行为必须遵循《中华人民共和国药品管理法》、《医疗器械监督管理条例》、《中华人民共和国合同法》、《中华人民共和国电子签名法》、《药品经营质量管理规范》、《药品流通监督管理办法》、《互联网药品信息服务管理办法》及《互联网药品交易服务审批暂行规定》等有关法律法规。</view>
|
||||
<view class="font-weight">二、平台服务对象</view>
|
||||
<view>平台服务对象是具有合法资质的医药、医疗器械及保健品经营企业和医疗机构等。平台服务对象必须成为平台注册会员,才能使用平台。平台服务对象通过线下资料认证后成为采购商会员可以在平台进行采购活动。</view>
|
||||
<view>平台服务对象要向平台提供真实、准确的资质材料(包括公司的名称、地址、联系电话、法人代表、银行账号和国家规定的相关证书和授权书等),资质材料如发生变更,应立即联系客服进行修改。</view>
|
||||
<view>如平台有合理理由怀疑服务对象资质材料不准确,平台有权暂停或终止用户的注册身份及资料,并拒绝用户在目前或将来对“服务”(或其任何部分)以任何形式使用。</view>
|
||||
<view>如服务对象的资质材料不真实、不准确,致使医点医滴平台或第三方受到任何直接或间接经济损失的,本平台有权随时取消服务对象的会员资格,所造成的损失应由服务对象全部承担。</view>
|
||||
<view>如因服务对象提供的资质材料不实或不准确而给自身造成任何性质的损失,其后果由服务对象自行承担。</view>
|
||||
<view>如由于服务对象自身保管不当,导致会员信息资料被他人窃用,其后果均由服务对象自行承担。</view>
|
||||
<view class="font-weight">三、平台服务内容</view>
|
||||
<view>(一)提供医药相关产品信息服务,帮助会员进行药品采购和提高经营效率。</view>
|
||||
<view>(二)提供采购订单跟踪、物流等服务。平台记录交易履约全程,保证交易可追溯。</view>
|
||||
<view>(三)为医药企业、产品、品牌提供推广服务。</view>
|
||||
<view>(四)平台提供的其他服务。</view>
|
||||
<view>(四)平台提供的其他服务。</view>
|
||||
<view class="font-weight">四、采购商会员权利义务</view>
|
||||
<view>(一)采购商会员采购行为必须符合各项法律、法规及平台的交易管理规则。会员自行承担因产品的违规采购产生的法律责任,并同意赔偿违反前述承诺给平台造成的损失,包括合理的追索费用。</view>
|
||||
<view>(二)采购商会员承诺通过交易平台从事医药电子商务符合国家有关法律、法规的规定,不利用平台进行任何非法交易活动,否则,本平台有权立即取消其会员资格,所造成的后果应由当事人全部承担,本平台不承担连带责任。</view>
|
||||
<view>(三)采购商会员享受平台提供的一站式服务,且应保证具备合法资质,并提供相应证明材料,会员资料应符合国家相关法律和规定,并对其真实性负全部责任。</view>
|
||||
<view>(四)采购商会员在平台采购应不超过经营范围采购商品,并按国家规范采购商品并提供相应证明文件。</view>
|
||||
<view class="font-weight">五、平台权利义务</view>
|
||||
<view>(一)平台为交易双方提供产品展示、信息沟通、订单处理、结算等服务。如出现技术障碍及时告知会员并组织修复,在此期间平台有权暂时停止以上服务,直至故障消除。</view>
|
||||
<view>(二)平台为会员提供的医药商品信息的版权和知识产权归平台所有,未经许可,任何单位和个人不得以任何形式复制、转载、出售、出版、传播信息资料,否则,本平台将追究其经济和法律责任。</view>
|
||||
<view>(三)平台保留对服务相关功能(例如药品信息管理、结算流程)变更、升级的权利。</view>
|
||||
<view>(四)根据法律法规及本平台交易的实际情况,平台有权修改有关条款,并于公示即时生效。会员在平台修改服务条款后继续使用服务,则被视作接受修改条款。</view>
|
||||
<view>(五)会员若因违法、违规侵害了第三方的合法权利,而导致第三方或行政、司法机关对金壶医药交易平台及金壶医药有限公司提出索赔或处罚要求(包括但不限于诉讼费、律师费、差旅费等),必须全额赔偿给金壶医药有限公司。</view>
|
||||
<view>(六) 平台有权对会员使用平台服务的情况进行审查和监督(包括但不限于对会员存储在平台的内容进行审核),如会员在使用网络服务时违反任何本条款规定,平台或其授权的人有权要求会员改正或直接采取一切必要的措施(包括但不限于暂停或终止会员使用网络服务的权利)以减轻会员不当行为造成的影响。如会员有违反规定导致任何法律后果的发生,会员应独立承担所有相应的法律责任。</view>
|
||||
<view class="font-weight">六、免责及责任的限制与排除</view>
|
||||
<view>(一)平台的会员名和密码只限会员使用,会员对使用该账号的一切行为承担法律责任。会员应采取一切合理安保措施保护其资料不被泄漏。如用户发现其账号遭他人非法使用,应立即通知平台。因用户的保管疏忽而产生的风险、损失由会员独自承担,本平台不承担责任。</view>
|
||||
<view>(二) 对于因不可抗力或平台不能控制的原因或其他意外事件(包括但不限于任何间接、偶然、特殊及继起的损害)造成的服务中断或其他缺陷,使得本条款履行不能,平台不承担任何责任,但将尽力减少因此而给客户造成的损失和影响。 不可抗力、不能控制的原因、意外事件是指不能预见、不能克服并不能避免且对一方或双方当事人造成重大影响的客观事件,包括但不限于自然灾害如洪水、地震、瘟疫流行等以及社会事件如战争、动乱、政府行为等。</view>
|
||||
<view class="font-weight">七、协议的中止和终止</view>
|
||||
<view>会员违反本协议规定或本协议附属规定的情况下,平台有权中止或终止本协议。协议终止并不意味着终止前所发生的未完成交易指令的撤销,也不能消除因终止前的交易所带来的任何法律后果。</view>
|
||||
<view class="font-weight">八、法律适用和争议解决</view>
|
||||
<view>(一)本协议一切事宜均适用中华人民共和国法律并依其解释。</view>
|
||||
<view>(二)若履行本协议发生争议,由双方友好协商解决;协商不成时,可向安徽金壶医药有限公司住所地人民法院提起诉讼。</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onShow() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
console.log(option,0)
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
||||
94
金壶/appV1/pages/my/goauthentication.vue
Normal file
94
金壶/appV1/pages/my/goauthentication.vue
Normal file
@@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<!-- 购物车 页面 -->
|
||||
<view class="content w-100 h-100 position-relative">
|
||||
<view class="header bg-linear-gradient x-text-white text-center ">
|
||||
认证
|
||||
<view class="edit_shoppingCar" @click="modification">修改</view>
|
||||
</view>
|
||||
<view class="img ">
|
||||
<image class="Pview img" src="../../static/1000.jpg" mode=""></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
// import {Config} from '@/utils/config'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isEdit: false, // 判断是否编辑购物车,true为编辑,false为不编辑
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
//去结算
|
||||
to_updata(){
|
||||
uni.navigateTo({
|
||||
url:'./Eauthentication'
|
||||
})
|
||||
},
|
||||
|
||||
// 登录
|
||||
to_login() {
|
||||
uni.navigateTo({
|
||||
url: 'x_login'
|
||||
});
|
||||
},
|
||||
|
||||
// 修改
|
||||
modification(){
|
||||
uni.navigateTo({
|
||||
url:'Eauthentication'
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
.img{
|
||||
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-top: -50px;
|
||||
margin-left: -100px;
|
||||
width: 100px;
|
||||
height: 100x;
|
||||
background: green;
|
||||
|
||||
}
|
||||
|
||||
.Pview{
|
||||
width: 585upx;
|
||||
height: 322upx;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
82
金壶/appV1/pages/my/gong_mes.vue
Normal file
82
金壶/appV1/pages/my/gong_mes.vue
Normal file
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<!-- 对公信息 页面 -->
|
||||
|
||||
<view class="content h-100">
|
||||
<HeaderTop page_title='对公账户信息'></HeaderTop>
|
||||
<view class="message d-flex j-sb border-bottom margin-zy20" style="line-height: 90upx;">
|
||||
<view>单位名称</view>
|
||||
<view>{{list.company_name}}</view>
|
||||
</view>
|
||||
<view class="message d-flex j-sb border-bottom margin-zy20" style="line-height: 90upx;">
|
||||
<view>纳税人识别码</view>
|
||||
<view>{{list.company_code}}</view>
|
||||
</view>
|
||||
<view class="message d-flex j-sb border-bottom margin-zy20" style="line-height: 90upx;">
|
||||
<view>地址</view>
|
||||
<view>{{list.address}}</view>
|
||||
</view>
|
||||
<view class="message d-flex j-sb border-bottom margin-zy20" style="line-height: 90upx;">
|
||||
<view>电话</view>
|
||||
<view>{{list.tel}}</view>
|
||||
</view>
|
||||
<view class="message d-flex j-sb border-bottom margin-zy20" style="line-height: 90upx;">
|
||||
<view>开户行</view>
|
||||
<view>{{list.bank_name}}</view>
|
||||
</view>
|
||||
<view class="message d-flex j-sb border-bottom margin-zy20" style="line-height: 90upx;">
|
||||
<view>账号</view>
|
||||
<view>{{list.account_number}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_login from '../../utils/models/x_login.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list_flag:'',
|
||||
list:''
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.messageList()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
this.list_flag = option.list_flag
|
||||
},
|
||||
methods: {
|
||||
async messageList(){
|
||||
let res = await X_login.X_accountInfo()
|
||||
this.handleError(res, res => {
|
||||
|
||||
this.list = res.data;
|
||||
|
||||
})
|
||||
},
|
||||
//对公打款
|
||||
gong(){
|
||||
|
||||
},
|
||||
// 返回
|
||||
goBack(){
|
||||
public_function.goBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
|
||||
}
|
||||
</style>
|
||||
108
金壶/appV1/pages/my/is_message.vue
Normal file
108
金壶/appV1/pages/my/is_message.vue
Normal file
@@ -0,0 +1,108 @@
|
||||
<template>
|
||||
<!-- 消息 页面 -->
|
||||
<view class="content">
|
||||
<PublicTop page_title='消息'></PublicTop>
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<view>
|
||||
<view v-if='messageList.length<=0' align="center">
|
||||
<image src="../../static/no/u/carno.png" mode="" class="noCar_img"></image>
|
||||
<view class="x_textCenter margin-shu20 font_28 x_text_hui">暂无消息</view>
|
||||
</view>
|
||||
<view class="padding-30" v-for="(item,index) of this.messageList" :key="index">
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom">
|
||||
<image src="../../static/my/mycar.png" mode="" class="" style="height:74upx; width:76upx;"></image>
|
||||
<view class="font-weight margin-zy20">{{item.biz_type_text}}</view>
|
||||
<view class="flex-1 x_text_hui">{{item.biz_title}}</view>
|
||||
<view class="">{{item.create_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loading-text">{{loadingText}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PublicTop from '../../components/HeaderTop/PublicTop.vue'
|
||||
import message from '../../utils/models/message.js'
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
cache:250,
|
||||
messageList:[],
|
||||
page:1,
|
||||
isScroll:true,
|
||||
loadingText:"",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PublicTop
|
||||
},
|
||||
//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
|
||||
onPullDownRefresh() {
|
||||
setTimeout(()=>{
|
||||
this.reload();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 1000);
|
||||
},
|
||||
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance"
|
||||
onReachBottom(){
|
||||
if(!this.isScroll){
|
||||
this.loadingText="到底了";
|
||||
return false;
|
||||
}else{
|
||||
this.loadingText="正在加载...";
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
async getList() {
|
||||
let parames = {
|
||||
page:this.page
|
||||
}
|
||||
|
||||
let data = await message.getList(parames)
|
||||
if(data.data.current_page == data.data.last_page){
|
||||
this.isScroll = false
|
||||
}
|
||||
for (let i = 0; i < data.data.data.length; i++) {
|
||||
this.messageList.push(data.data.data[i])
|
||||
}
|
||||
this.page++
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if(this.page){
|
||||
this.isScroll = true
|
||||
this.serviceList = []
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place{
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
.noCar_img{
|
||||
height:238upx;
|
||||
width:350upx;
|
||||
margin-top: 100upx;
|
||||
}
|
||||
.loading-text{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 60upx;
|
||||
color: #979797;
|
||||
font-size: 24upx;
|
||||
}
|
||||
</style>
|
||||
393
金壶/appV1/pages/my/my.vue
Normal file
393
金壶/appV1/pages/my/my.vue
Normal file
@@ -0,0 +1,393 @@
|
||||
<template>
|
||||
<!-- 我的 页面 -->
|
||||
<view class="content w-100 h-100 bg_F2F2F2">
|
||||
<view class="info w-100 d-flex bg-linear-gradient">
|
||||
<view class="head_portrait">
|
||||
<!-- <img src="../../static/my/touxiang.png" alt="" class='h-100 w-100'> -->
|
||||
<image src="../../static/my/touxiang.png" alt="" class='h-100 w-100'></image>
|
||||
</view>
|
||||
<view class="d-flex x-text-white info_txt">
|
||||
<view class="" @click="to_login()" v-if="is_login==false">注册/登录</view>
|
||||
<view class="" v-if="is_login==true">{{userPhone}}</view>
|
||||
</view>
|
||||
<image src="../../static/my/shezhi.png" mode="" class="set_up" @click="toSetting()"></image>
|
||||
<image src="../../static/my/message.png" mode="" class="h-100 w-100 mes" @click="to_message()"></image>
|
||||
</view>
|
||||
<view class='padding-zy30'>
|
||||
<view class="x_public_box info_item">
|
||||
<!-- 我的订单 -->
|
||||
<view class="my_order x_margin0auto ">
|
||||
<view class="order_tip d-flex j-sb a-center x-border-hui padding-zy30" @click="to_order(0)">
|
||||
<view class="">我的订单</view>
|
||||
<image src="../../static/my/right.png" mode="" class="order_back"></image>
|
||||
</view>
|
||||
|
||||
<view class="order_items d-flex j-around" style="padding-top: 30upx;">
|
||||
<!-- // 1 待付款 2代发货 6待收货 3已完成 -->
|
||||
<view @click="to_order(1)" class="order_item_box">
|
||||
<image src="../../static/my/bag2.png" mode="" class="order_img"></image>
|
||||
<view>待付款</view>
|
||||
<!-- <view class="order_num" v-if='item.order_status==1'>{{item.count}}</view> -->
|
||||
<view class="order_num" v-if='order_num[0].count'>{{order_num[0].count}}</view>
|
||||
</view>
|
||||
<view @click="to_order(2)" class="order_item_box">
|
||||
<image src="../../static/my/bag1.png" mode="" class="order_img"></image>
|
||||
<view>待发货</view>
|
||||
<!-- <view class="order_num" v-if='item.order_status==2'>{{item.count}}</view> -->
|
||||
<view class="order_num" v-if='order_num[1].count'>{{order_num[1].count}}</view>
|
||||
</view>
|
||||
<view @click="to_order(3)" class="order_item_box">
|
||||
|
||||
<image src="../../static/my/mycar.png" mode="" class="order_img"></image>
|
||||
<view>待收货</view>
|
||||
<view class="order_num" v-if='order_num[2].count'>{{order_num[2].count}}</view>
|
||||
<!-- <view class="order_num" v-if='item.order_status==6'>{{item.count}}</view> -->
|
||||
</view>
|
||||
<view @click="to_order(4)" class="order_item_box">
|
||||
<image src="../../static/my/dui.png" mode="" class="order_img"></image>
|
||||
<view>已完成</view>
|
||||
<view class="order_num" v-if='order_num[3].count'>{{order_num[3].count}}</view>
|
||||
<!-- <view class="order_num" v-if='item.order_status==3'>{{item.count}}</view> -->
|
||||
</view>
|
||||
<!-- <view @click="to_refund()">
|
||||
<image src="../../static/my/qian.png" mode="" class="order_img"></image>
|
||||
<view>退款/售后</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="x_public_box">
|
||||
<!-- 我的服务 -->
|
||||
<view class="my_order x_margin0auto my_service">
|
||||
<view class="order_tip d-flex j-sb a-center x-border-hui padding-zy30">
|
||||
<view class="">我的服务</view>
|
||||
</view>
|
||||
<view class="service_items d-flex j-around">
|
||||
<view @click="Eauthentication()">
|
||||
<image src="../../static/my/add.png" mode="" class="service_img"></image>
|
||||
<view>企业认证</view>
|
||||
</view>
|
||||
<view @click="to_opinion()">
|
||||
<image src="../../static/my/mykefu.png" mode="" class="service_img"></image>
|
||||
<view>专属客服</view>
|
||||
</view>
|
||||
<view @click="pathList()">
|
||||
<image src="../../static/my/location.png" mode="" class="service_img"></image>
|
||||
<view>收货地址</view>
|
||||
</view>
|
||||
<view @click="go_collect()">
|
||||
<image src="../../static/my/star.png" mode="" class="service_img"></image>
|
||||
<view>我的收藏</view>
|
||||
</view>
|
||||
<view @click="duigong()">
|
||||
<image src="../../static/my/gong.png" mode="" class="service_img"></image>
|
||||
<view>对公信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="Copyright text-center x_text_hui">
|
||||
<view>Copyright©2014-2020</view>
|
||||
<view>医点医滴平台 版权所有</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import {
|
||||
Config
|
||||
} from '../../utils/config.js'
|
||||
import X_login from '../../utils/models/x_login.js'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
is_login: false,
|
||||
userPhone: '',
|
||||
order_num:[
|
||||
{"order_status":1,"count":0},
|
||||
{"order_status":2,"count":0},
|
||||
{"order_status":6,"count":0},
|
||||
{"order_status":3,"count":0}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
beforeCreate() {
|
||||
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.istell();
|
||||
},
|
||||
onShow() {
|
||||
this.istell();
|
||||
this.get_order_count();
|
||||
},
|
||||
methods: {
|
||||
// 获取订单数量
|
||||
async get_order_count() {
|
||||
let res = await X_goods.x_order_count()
|
||||
this.order_num = res.data
|
||||
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 对公信息
|
||||
duigong() {
|
||||
uni.navigateTo({
|
||||
url: './gong_mes'
|
||||
})
|
||||
},
|
||||
async istell() {
|
||||
|
||||
let res = await X_login.x_tell()
|
||||
|
||||
this.userPhone = res.data;
|
||||
if(res.data){
|
||||
this.is_login = true
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
// this.userPhone = res.data;
|
||||
|
||||
})
|
||||
},
|
||||
// 获取用户手机号
|
||||
// async istell() {
|
||||
// uni.getStorage({
|
||||
// key: 'isAuthentication',
|
||||
// success: function(res) {
|
||||
// // console.log(res,'zheshi');
|
||||
// if (res.data == '') {
|
||||
// uni.navigateTo({
|
||||
// url: './x_login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// let res = await X_login.x_tell()
|
||||
// this.handleError(res, res => {
|
||||
// if (res.data == '') {
|
||||
// uni.getStorage({
|
||||
// key: 'isAuthentication',
|
||||
// success: function(res) {
|
||||
// if (res.data == '') {
|
||||
|
||||
// uni.navigateTo({
|
||||
// url: './x_login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// this.userPhone = res.data;
|
||||
|
||||
// this.is_login = true
|
||||
// if (this.userPhone == undefined || '') {
|
||||
// uni.navigateTo({
|
||||
// url: './x_login'
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
// })
|
||||
// },
|
||||
// 认证
|
||||
to_Authentication() {
|
||||
uni.navigateTo({
|
||||
url: 'authentication'
|
||||
})
|
||||
},
|
||||
//意见反馈
|
||||
to_opinion() {
|
||||
uni.navigateTo({
|
||||
url: 'opinion'
|
||||
})
|
||||
},
|
||||
// 退款/售后
|
||||
to_refund() {
|
||||
uni.navigateTo({
|
||||
url: '../refund/refund'
|
||||
})
|
||||
},
|
||||
// 我的订单
|
||||
to_order(index) {
|
||||
uni.navigateTo({
|
||||
url: '../order/index?is_index=' + index
|
||||
})
|
||||
},
|
||||
// 消息
|
||||
to_message() {
|
||||
uni.navigateTo({
|
||||
url: 'is_message'
|
||||
})
|
||||
},
|
||||
// 设置
|
||||
toSetting() {
|
||||
uni.navigateTo({
|
||||
url: './setting'
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
to_login() {
|
||||
uni.navigateTo({
|
||||
url: 'x_login'
|
||||
});
|
||||
},
|
||||
// 收藏
|
||||
go_collect() {
|
||||
uni.navigateTo({
|
||||
url: './collect'
|
||||
})
|
||||
},
|
||||
// 收获地址
|
||||
pathList() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/my/path-change'
|
||||
})
|
||||
},
|
||||
// 企业认证
|
||||
Eauthentication() {
|
||||
uni.navigateTo({
|
||||
url: '../auth/is_Authentication'
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.info {
|
||||
position: relative;
|
||||
height: 340upx;
|
||||
padding: 0 10upx;
|
||||
|
||||
.head_portrait {
|
||||
height: 128upx;
|
||||
width: 128upx;
|
||||
position: absolute;
|
||||
top: 102upx;
|
||||
left: 30upx;
|
||||
}
|
||||
|
||||
.info_txt {
|
||||
line-height: 122upx;
|
||||
position: absolute;
|
||||
top: 116upx;
|
||||
left: 200upx;
|
||||
font-size: 30upx;
|
||||
}
|
||||
|
||||
.set_up {
|
||||
position: absolute;
|
||||
bottom: 233upx;
|
||||
right: 127upx;
|
||||
height: 41upx;
|
||||
width: 45upx;
|
||||
}
|
||||
|
||||
.mes {
|
||||
width: 44upx;
|
||||
height: 38upx;
|
||||
position: absolute;
|
||||
right: 43upx;
|
||||
top: 72upx;
|
||||
}
|
||||
}
|
||||
|
||||
.info_item {
|
||||
height: 248upx;
|
||||
margin-top: -82upx;
|
||||
position: relative;
|
||||
z-index: 30;
|
||||
|
||||
.the_items {
|
||||
padding-top: 10upx;
|
||||
}
|
||||
}
|
||||
|
||||
.my_order {
|
||||
height: 200upx;
|
||||
margin: 0 auto;
|
||||
|
||||
.order_tip {
|
||||
line-height: 80upx;
|
||||
border-bottom: 2upx solid #F4F4F4;
|
||||
}
|
||||
|
||||
.order_items {
|
||||
text-align: center;
|
||||
|
||||
padding-top: 15upx;
|
||||
|
||||
|
||||
.order_item_box{
|
||||
position: relative;
|
||||
|
||||
|
||||
}
|
||||
.order_img {
|
||||
|
||||
height: 52upx;
|
||||
width: 61upx;
|
||||
|
||||
}
|
||||
.order_num{
|
||||
position: absolute;
|
||||
top:-16upx;
|
||||
right:-16upx;
|
||||
// padding: 2upx 10upx;
|
||||
height:40upx;
|
||||
width:40upx;
|
||||
line-height: 40upx;
|
||||
|
||||
color:#FFFFFF;
|
||||
border-radius: 50%;
|
||||
background-color: red;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.service_items {
|
||||
text-align: center;
|
||||
padding-top: 26upx;
|
||||
}
|
||||
|
||||
.order_back {
|
||||
height: 30upx;
|
||||
width: 19upx;
|
||||
}
|
||||
}
|
||||
|
||||
.my_service {
|
||||
height: 352upx;
|
||||
|
||||
.service_img {
|
||||
height: 91upx;
|
||||
width: 91upx;
|
||||
}
|
||||
}
|
||||
|
||||
.Copyright {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 30upx;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
95
金壶/appV1/pages/my/opinion.vue
Normal file
95
金壶/appV1/pages/my/opinion.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<!-- 意见反馈 页面 -->
|
||||
<view class="content bg_F2F2F2">
|
||||
<HeaderTop page_title='专属客服'></HeaderTop>
|
||||
<view class="list bg_F2F2F2">
|
||||
<view class="top bg-linear-gradient w-100">
|
||||
<!-- <img src="../../static/my/zhuanshukefu.png" alt="" class='kefu'> -->
|
||||
<image src="../../static/my/zhuanshukefu.png" alt="" class='kefu'></image>
|
||||
</view>
|
||||
<view class="x-bg-white info" v-for="(item,index) in list" :key="index" >
|
||||
<view class="d-flex border-bottom">
|
||||
<view class="font-weight">客服名称</view>
|
||||
<view class="margin-zy20">{{item.nickname}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb a-center">
|
||||
<view class="font-weight">联系方式</view>
|
||||
<view class="margin-zy20 text-left flex-1" @tap='to_call(item)'>{{item.mobile}}</view>
|
||||
<image src="../../static/my/dianhua.png" mode="" class="tell" @tap='to_call(item)'></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list:''
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onShow() {
|
||||
this.the_custOmer()
|
||||
},
|
||||
components: {
|
||||
|
||||
|
||||
},
|
||||
methods: {
|
||||
to_call(item){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: item.mobile //仅为示例
|
||||
});
|
||||
},
|
||||
// x_custOmer
|
||||
async the_custOmer() {
|
||||
let res = await X_goods.x_custOmer()
|
||||
console.log(res)
|
||||
this.list = res.data
|
||||
console.log(this.list)
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.list{
|
||||
.top{
|
||||
height:240upx;
|
||||
text-align: center;
|
||||
.kefu{
|
||||
height:180upx;
|
||||
width:180upx;
|
||||
border-radius: 50%;
|
||||
margin-top:126upx;
|
||||
}
|
||||
}
|
||||
.info{
|
||||
width:690upx;
|
||||
border-radius: 30upx;
|
||||
margin:100upx auto;
|
||||
padding: 0 30upx;
|
||||
line-height: 100upx;
|
||||
.tell{
|
||||
height:34upx;
|
||||
width:28upx;
|
||||
}
|
||||
}
|
||||
.other{
|
||||
width:100%;
|
||||
position: fixed;
|
||||
bottom:50upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
237
金壶/appV1/pages/my/path-change.vue
Normal file
237
金壶/appV1/pages/my/path-change.vue
Normal file
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<!-- 收货地址 -->
|
||||
<view class="w-100 h-100 all">
|
||||
<HeaderTop page_title='收货地址'></HeaderTop>
|
||||
<view class="list">
|
||||
<view class="list_item d-flex j-sb j-center a-center padding-30 border-bottom" v-for="(item,index) in dataList" :key="index">
|
||||
<!-- <radio value="" :checked="item.checked" style="width:10%;" v-if="goods_id!=''" /> -->
|
||||
<view class="items_info flex-1 padding-zy30">
|
||||
<view class="d-flex">
|
||||
<view>{{item.consignee}}</view>
|
||||
<view class='margin-zy20'>{{item.tel}}</view>
|
||||
<view class="is_choose margin-zy20" v-if='item.is_default!=0'>默认</view>
|
||||
</view>
|
||||
<view>
|
||||
{{item.address}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<image src="../../static/shoppingCart/edit1.png" mode="" style="height:40upx; width:40upx;margin-right: 30upx;" @click.stop="edit(index)"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <block v-for="(item,index) in dataList" :key="index">
|
||||
<uni-swipe-action :options="options"
|
||||
@click="bindClick($event,index)">
|
||||
<uni-list-item @click="choose(item)">
|
||||
<view class="text-secondary text-dark">
|
||||
<view class="d-flex a-center">
|
||||
<text class="text-dark mr-2 font-weight">{{item.consignee}}</text>
|
||||
{{item.tel}}
|
||||
<text class="main-text-color ml-2"
|
||||
v-if="item.isdefault">[默认]</text>
|
||||
</view>
|
||||
<view>{{item.area_name}} {{"("}}{{item.address}}{{")"}}</view>
|
||||
</view>
|
||||
</uni-list-item>
|
||||
</uni-swipe-action>
|
||||
</block> -->
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 shadow addBtn w-90" style="line-height: 80upx;" @click="addPath()">新增收货地址</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from '@/store/index.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import uniListItem from "@/components/uni-ui/uni-list-item/uni-list-item.vue"
|
||||
import uniSwipeAction from "@/components/uni-ui/uni-swipe-action/uni-swipe-action.vue"
|
||||
import {mapState,mapMutations} from "vuex"
|
||||
|
||||
import shippingAddress from '../../utils/models/shop.js'
|
||||
export default {
|
||||
components: {
|
||||
uniListItem,
|
||||
uniSwipeAction,
|
||||
HeaderTop
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
address_id:'',
|
||||
goods_id:'',
|
||||
dataList:[], //数据列表
|
||||
|
||||
isChoose:false,
|
||||
options: [{
|
||||
text: '编辑',
|
||||
style: {
|
||||
backgroundColor: '#007aff'
|
||||
}
|
||||
}, {
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#dd524d'
|
||||
}
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
|
||||
|
||||
|
||||
list:state=>state.path.list
|
||||
}),
|
||||
},
|
||||
|
||||
onLoad(option) {
|
||||
if (option.type === '') {
|
||||
this.isChoose = true
|
||||
}
|
||||
if(option.goods_id){
|
||||
|
||||
this.goods_id = option.goods_id
|
||||
|
||||
}
|
||||
// 请求数据
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
// 编辑地址
|
||||
edit(index){
|
||||
// console.log(this.goods_id)
|
||||
uni.redirectTo({
|
||||
url:'./user-path-edit?address_item='+JSON.stringify(this.dataList[index])
|
||||
})
|
||||
console.log(JSON.stringify(this.dataList[index]));
|
||||
|
||||
// {"id":286,
|
||||
// "area_id":216,
|
||||
// "address":"aeawef",
|
||||
// "consignee":"天空",
|
||||
// "tel":"1565654848",
|
||||
// "is_default":0,
|
||||
// "area_name":"河南省 - 洛阳市 - 嵩县",
|
||||
// "short_consignee":"天空",
|
||||
// "checked":fals,
|
||||
// }
|
||||
},
|
||||
// 选择地址
|
||||
|
||||
// 地址列表
|
||||
async getData(){
|
||||
let res = await shippingAddress.addressList();
|
||||
this.handleError(res, res => {
|
||||
|
||||
this.dataList = res.data.data.list
|
||||
|
||||
|
||||
this.dataList.forEach(item=>{
|
||||
|
||||
item.checked = false
|
||||
this.address_id = item.id
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
async deletelist(){
|
||||
let res = await shippingAddress.deleteAddress(this.address_id);
|
||||
this.handleError(res, res => {
|
||||
|
||||
if(res.code == 200){
|
||||
uni.showToast({
|
||||
title:'删除成功'
|
||||
})
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
async bindClick(value,i) {
|
||||
let res;
|
||||
switch (value.index){
|
||||
case 0: // 修改
|
||||
let obj = JSON.stringify({
|
||||
index:i,
|
||||
item:this.address_id
|
||||
})
|
||||
setTimeout(()=> {
|
||||
uni.redirectTo({
|
||||
url: '../my/user-path-edit?data='+obj,
|
||||
});
|
||||
},50);
|
||||
break;
|
||||
case 1: // 删除
|
||||
let res = await shippingAddress.deleteAddress(this.address_id);
|
||||
this.handleError(res, res => {
|
||||
|
||||
if(res.code == 200){
|
||||
uni.showModal({
|
||||
content: '要删除该收货地址吗?',
|
||||
success(res){
|
||||
if(res.confirm){
|
||||
uni.showToast({
|
||||
title:'删除成功'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 选择收货地址
|
||||
// choose(item){
|
||||
// if (this.isChoose) {
|
||||
// // 通知订单提交页修改收货地址
|
||||
// uni.$emit('choosePath',item)
|
||||
// // 关闭当前页面
|
||||
// uni.navigateBack({
|
||||
// delta: 1
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// 新增地址
|
||||
addPath() {
|
||||
uni.redirectTo({
|
||||
url: '../my/user-path-add'
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.is_choose{
|
||||
background-color: #EDCA4A;
|
||||
color: #FFFFFF;
|
||||
height:50upx;
|
||||
line-height: 50upx;
|
||||
padding: 0 15upx;
|
||||
font-size: 28upx;
|
||||
border-radius: 20upx;
|
||||
}
|
||||
.list{
|
||||
height:calc(100% - 300upx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.addBtn{
|
||||
position: absolute;
|
||||
bottom:0upx;
|
||||
left: 34upx;
|
||||
}
|
||||
|
||||
</style>
|
||||
190
金壶/appV1/pages/my/pay_success.vue
Normal file
190
金壶/appV1/pages/my/pay_success.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<!-- 支付成功 页面 -->
|
||||
<view class="content h-100">
|
||||
<view class="banner">
|
||||
<!-- <image src="../../static/my/left.png" mode="" class="back" @click="goBack()"></image> -->
|
||||
<view class="page_title text-center x-text-white">支付</view>
|
||||
<view class="pay_state d-flex a-center j-center">
|
||||
<image src="../../static/shoppingCart/dui.png" mode="" class="margin-zy20" style="height:84upx; width:92upx;"></image>
|
||||
<view class="x-text-white" style="font-size: 34upx;" v-if='list_flag==4 || list_flag==5'>支付成功</view>
|
||||
<view class="x-text-white" style="font-size: 34upx;" v-if='list_flag==1 || list_flag==2'>订单提交成功</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-center margin-shu20" v-if='list_flag==1 || list_flag==2'>请尽快完成支付,超时系统将取消订单</view>
|
||||
<view class="text-center margin-shu20" v-if='list_flag==4 || list_flag==5'>感谢您的购买,我们将尽快为您发货</view>
|
||||
<view class="two_btn d-flex j-sb w-90" style="margin:50upx auto;">
|
||||
<view class="x_public_box x-text-white x-bg-159" style="line-height: 80upx; width:45%;" @click="lookOrder()">查看订单</view>
|
||||
<view class="x_public_box x-text-white" style="width:45%; background-color: #F4C91C; line-height:80upx;" v-if='list_flag==4 || list_flag==5' @click="gohome()">返回首页</view>
|
||||
<view class="x_public_box x-text-white" style="width:45%; background-color: #F4C91C; line-height:80upx;" v-if='list_flag==1 || list_flag==2' @click="gong()">对公打款</view>
|
||||
</view>
|
||||
|
||||
<view class="x-bg-white info" v-for="(item,index) in list" :key="index" >
|
||||
<view class="d-flex border-bottom">
|
||||
<view class="font-weight">客服名称</view>
|
||||
<view class="margin-zy20">{{item.nickname}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb a-center">
|
||||
<view class="font-weight">联系方式</view>
|
||||
<view class="margin-zy20 text-left flex-1" @tap='to_call(item)'>{{item.mobile}}</view>
|
||||
<image src="../../static/my/dianhua.png" mode="" class="tell" @tap='to_call(item)'></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
// import {Config} from '../../utils/config.js'
|
||||
import {Config} from '../../utils/config.js'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list_flag:'',
|
||||
list:''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
onLoad(option) {
|
||||
//console.log(option)
|
||||
|
||||
//this.list_flag = option.list_flag
|
||||
},
|
||||
onShow() {
|
||||
this.list_flag = Config.list_flag
|
||||
this.the_custOmer()
|
||||
},
|
||||
methods: {
|
||||
// 查看订单
|
||||
lookOrder(){
|
||||
uni.navigateTo({
|
||||
url:'../../pages/order/index'
|
||||
})
|
||||
},
|
||||
//对公打款
|
||||
gong(){
|
||||
uni.navigateTo({
|
||||
url:'./gong_mes'
|
||||
})
|
||||
},
|
||||
// 返回首页
|
||||
gohome(){
|
||||
uni.switchTab({
|
||||
url: '../home/home'
|
||||
})
|
||||
},
|
||||
// 返回
|
||||
goBack(){
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
|
||||
// 拨打电话
|
||||
to_call(item){
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: item.mobile //仅为示例
|
||||
});
|
||||
},
|
||||
// x_custOmer
|
||||
async the_custOmer() {
|
||||
let res = await X_goods.x_custOmer()
|
||||
console.log(res)
|
||||
this.list = res.data
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.banner{
|
||||
height:511upx;
|
||||
position: relative;
|
||||
background-image: url(../../static/shoppingCart/bgsucc.png);
|
||||
background-position: 100% 100%;
|
||||
background-size: cover;
|
||||
padding-top:70upx;
|
||||
.pay_state{
|
||||
margin-top:50upx;
|
||||
}
|
||||
.page_title{
|
||||
// line-height: 118upx;
|
||||
font-size: 32upx;
|
||||
}
|
||||
|
||||
.back{
|
||||
position: absolute;
|
||||
top:80upx;
|
||||
left:33upx;
|
||||
height:31upx;
|
||||
width:19upx;
|
||||
}
|
||||
}
|
||||
.login{
|
||||
margin-top:60upx;
|
||||
}
|
||||
.my_form{
|
||||
.my_form_menu{
|
||||
.menu_items{
|
||||
margin-right:44upx;
|
||||
}
|
||||
}
|
||||
.menu_active{
|
||||
color: #282828;
|
||||
font-size: 32upx;
|
||||
border-bottom:4upx solid #6B68DC;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.my_input{
|
||||
padding:100upx 64upx;
|
||||
.two_input{
|
||||
border-bottom:1upx solid #F2F2F2;
|
||||
height:100upx;
|
||||
}
|
||||
}
|
||||
.forget_password{
|
||||
display: inline-block;
|
||||
margin:15upx 0;
|
||||
color: #6B6AD5;
|
||||
border-bottom: 1upx solid #6B6AD5;
|
||||
}
|
||||
.agree {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
white-space: normal !important;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical
|
||||
}
|
||||
.besthelp{
|
||||
padding-left: 170upx;
|
||||
color:#ff1c00eb;
|
||||
font-size: 16px;
|
||||
margin-top: 15upx;
|
||||
.callphone{
|
||||
display: inline-block;
|
||||
width:35upx;
|
||||
height:35upx;
|
||||
margin-left:35upx;
|
||||
}
|
||||
}
|
||||
.info{
|
||||
background-color: #eeeeee6e;
|
||||
width:690upx;
|
||||
border-radius: 30upx;
|
||||
margin:40upx auto;
|
||||
padding: 0 30upx;
|
||||
line-height: 100upx;
|
||||
.tell{
|
||||
height:34upx;
|
||||
width:28upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
201
金壶/appV1/pages/my/pay_type.vue
Normal file
201
金壶/appV1/pages/my/pay_type.vue
Normal file
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<!-- 支付订单 页面 -->
|
||||
<view class="content bg_F2F2F2">
|
||||
<HeaderTop page_title='支付订单'></HeaderTop>
|
||||
<view class="x_text_hui text-center time">支付剩余时间{{list.deadline_time}}</view>
|
||||
<view class="text-center">¥ <text class="font-weight money">{{list.total_amount}}</text></view>
|
||||
<view class="pay_types x-bg-white w-90 " style="border-radius: 20upx; margin:100upx auto;">
|
||||
<view class="d-flex padding-30 border-bottom" @click="radioChange(1)">
|
||||
<!-- <image src="../../static/shoppingCart/weixin.png" mode=""></image> -->
|
||||
<!-- <view style='height:50upx;width:50upx; border:1px solid red;' :style="{backgroundImage:'url(${zhifubao})',backgroundSize: 'cover'}">
|
||||
<img src="../../static/shoppingCart/zhifubao.png" alt="">
|
||||
</view> -->
|
||||
<!-- <view style="background-image:url(../../static/shoppingCart/zhifubao.png);"></view>
|
||||
<view :style="{backgroundImage:'url(../../static/shoppingCart/zhifubao.png)'}"></view> -->
|
||||
<!-- <img src="../../static/shoppingCart/zhifubao.png" alt="" style='50upx;width:50upx;'> -->
|
||||
<image src="../../static/shoppingCart/zhifubao.png" mode="" style='height:50upx;width:50upx;'></image>
|
||||
<view class="flex-1 padding-zy30">支付宝支付</view>
|
||||
<radio value="支付宝支付" :checked="current==1" style="width:10%;" />
|
||||
</view>
|
||||
<view class="d-flex padding-30 border-bottom" @click="radioChange(2)">
|
||||
<image src="../../static/shoppingCart/weixin.png" mode="" style='height:50upx;width:50upx;'></image>
|
||||
<view class="flex-1 padding-zy30">微信支付</view>
|
||||
<radio value="微信支付" :checked="current==2" style="width:10%;" />
|
||||
</view>
|
||||
<view class="d-flex padding-30 border-bottom" @click="radioChange(3)">
|
||||
<image src="../../static/shoppingCart/gong.png" mode="" style='height:50upx;width:50upx;'></image>
|
||||
<view class="flex-1 padding-zy30">公对公打款</view>
|
||||
<radio value="公对公打款" :checked="current==3" style="width:10%;" />
|
||||
</view>
|
||||
<view class="d-flex padding-30" @click="radioChange(4)" v-if="list.is_new_user === 1">
|
||||
<image src="../../static/shoppingCart/huo.png" mode="" style='height:50upx;width:50upx;'></image>
|
||||
<view class="flex-1 padding-zy30">货到付款</view>
|
||||
<radio value="货到付款" :checked="current==4" style="width:10%;" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="x_public_box sureBtn x-bg-159 x-text-white w-90" @click="pay()">确定</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import {
|
||||
Config
|
||||
} from '../../utils/config.js'
|
||||
import zhifubao from "../../static/shoppingCart/zhifubao.png"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
current: '',
|
||||
order_id: '',
|
||||
list: '',
|
||||
list_flag: '' // 1货到付款,值2线下支付,值3小程序支付,值4微信支付,值5支付宝支付
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.isPay();
|
||||
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onLoad(option) {
|
||||
this.order_id = option.order_id
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'backbutton') {
|
||||
uni.redirectTo({
|
||||
url: '../../pages/order/index?is_index=1',
|
||||
});
|
||||
}
|
||||
return true
|
||||
},
|
||||
// onBackPress(options) {
|
||||
// uni.navigateTo({
|
||||
// url: '../../pages/order/index',
|
||||
// });
|
||||
// },
|
||||
methods: {
|
||||
// 支付
|
||||
async isPay() {
|
||||
let res = await X_goods.X_toPay(this.order_id)
|
||||
this.handleError(res, res => {
|
||||
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
// 调用支付 X_appPay
|
||||
async pay() {
|
||||
list_flag: '' // 1货到付款,值2线下支付,值3小程序支付,值4微信支付,值5支付宝支付
|
||||
if (this.current == 1) { //支付宝支付
|
||||
this.list_flag = 5
|
||||
Config.list_flag = this.list_flag
|
||||
let res = await X_goods.X_appPay(this.order_id, this.list_flag)
|
||||
let orderInfo = res.data.aliPayInfo
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: orderInfo,
|
||||
success: function(res) {
|
||||
uni.redirectTo({
|
||||
url: './pay_success'
|
||||
})
|
||||
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
},
|
||||
fail: function(err) {
|
||||
uni.redirectTo({
|
||||
url: '../order/index'
|
||||
})
|
||||
}
|
||||
});
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
}
|
||||
if (this.current == 2) { // 微信支付
|
||||
this.list_flag = 4
|
||||
Config.list_flag = this.list_flag
|
||||
let res = await X_goods.X_appPay(this.order_id, this.list_flag)
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
let orderInfo = res.data.wxPayInfo
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: orderInfo, //微信、支付宝订单数据
|
||||
success: function(res) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
uni.redirectTo({
|
||||
url: './pay_success'
|
||||
})
|
||||
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
console.log(res, 'shishi')
|
||||
uni.redirectTo({
|
||||
url: '../order/index'
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.current == 3) { // 线下支付
|
||||
this.list_flag = 2
|
||||
Config.list_flag = this.list_flag
|
||||
let res = await X_goods.X_appPay(this.order_id, this.list_flag)
|
||||
uni.redirectTo({
|
||||
url: './pay_success'
|
||||
})
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
}
|
||||
if (this.current == 4) { // 货到付款
|
||||
this.list_flag = 1
|
||||
Config.list_flag = this.list_flag
|
||||
let res = await X_goods.X_appPay(this.order_id, this.list_flag)
|
||||
uni.redirectTo({
|
||||
url: './pay_success'
|
||||
})
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
//选择支付方式
|
||||
radioChange(e) {
|
||||
console.log(333)
|
||||
this.current = e
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.time {
|
||||
margin: 60upx 0;
|
||||
}
|
||||
|
||||
.money {
|
||||
font-size: 52upx;
|
||||
}
|
||||
|
||||
.sureBtn {
|
||||
line-height: 82upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
57
金壶/appV1/pages/my/personal_center.vue
Normal file
57
金壶/appV1/pages/my/personal_center.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<!-- 个人中心 页面 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='个人中心'></HeaderTop>
|
||||
<view class="padding-30">
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list" @click="to_bind_phone()">
|
||||
<view class="">手机号</view>
|
||||
<image src="../../static/my/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list" @click="to_change_pass()">
|
||||
<view class="">修改密码</view>
|
||||
<image src="../../static/my/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
methods:{
|
||||
to_bind_phone(){
|
||||
uni.navigateTo({
|
||||
url:'bind_phone'
|
||||
})
|
||||
},
|
||||
to_change_pass(){
|
||||
uni.navigateTo({
|
||||
url:'change_password'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
position: relative;
|
||||
.list{
|
||||
height: 83upx;
|
||||
}
|
||||
.esc_login{
|
||||
line-height: 82upx;
|
||||
position: absolute;
|
||||
bottom:100upx;
|
||||
left: 34upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
135
金壶/appV1/pages/my/setting.vue
Normal file
135
金壶/appV1/pages/my/setting.vue
Normal file
@@ -0,0 +1,135 @@
|
||||
<template>
|
||||
<!-- 设置 页面 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='设置'></HeaderTop>
|
||||
<view class="padding-30">
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list" @click="to_editPassword()">
|
||||
<view class="">修改密码</view>
|
||||
<image src="../../static/my/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list" @click="phone_message()">
|
||||
<view class="">消息提醒设置</view>
|
||||
<image src="../../static/my/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
<view class="padding-zy30 d-flex j-sb a-center border-bottom list" @click="clear_cache()">
|
||||
<view class="">清除缓存</view>
|
||||
<view class="p_right cache_right">{{currentSize}}{{currentSizeText}}</view>
|
||||
</view>
|
||||
<view class="x_public_box x-bg-159 esc_login x-text-white w-90" style="line-height: 80upx;" @click="esc_login()">退出登录</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import permission from '../../common/permission.js' //正则验证
|
||||
import uploadImage from '@/common/ossutil/uploadFile.js';
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
cache:250,
|
||||
currentSize:0,
|
||||
currentSizeText:'K'
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
methods:{
|
||||
// 退出登录
|
||||
esc_login(){
|
||||
uni.navigateTo({
|
||||
url:'./x_login'
|
||||
})
|
||||
uni.clearStorage();
|
||||
},
|
||||
// 清除缓存
|
||||
clear_cache(){
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定清空缓存',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
that.do_clear_cache()
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
do_clear_cache(){
|
||||
try {
|
||||
const value = uni.getStorageSync('isAuthentication');
|
||||
|
||||
if (value) {
|
||||
let that = this
|
||||
uni.clearStorage({
|
||||
success: function (res) {
|
||||
uni.setStorageSync('isAuthentication', value);
|
||||
that.get_cache()
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
},
|
||||
// 获取缓存
|
||||
get_cache(){
|
||||
let that = this
|
||||
uni.getStorageInfo({
|
||||
success: function (res) {
|
||||
if(res.currentSize >= 1024 && res.currentSize/1024 < 1024){
|
||||
that.currentSize = res.currentSize/1024
|
||||
that.currentSizeText = 'M'
|
||||
}
|
||||
if(res.currentSize/1024 >= 1024){
|
||||
that.currentSize = res.currentSize/1024/1024
|
||||
that.currentSizeText = 'G'
|
||||
}
|
||||
if(res.currentSize < 1024 && res.currentSize > 3){
|
||||
that.currentSize = res.currentSize
|
||||
that.currentSizeText = 'K'
|
||||
}
|
||||
if(res.currentSize <= 3){
|
||||
that.currentSize = '0'
|
||||
that.currentSizeText = 'K'
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 个人信息
|
||||
to_editPassword(){
|
||||
uni.navigateTo({
|
||||
url:'change_password'
|
||||
})
|
||||
},
|
||||
phone_message(){
|
||||
permission.gotoAppSetting()
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.get_cache()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
position: relative;
|
||||
.list{
|
||||
height: 83upx;
|
||||
}
|
||||
.esc_login{
|
||||
line-height: 82upx;
|
||||
position: absolute;
|
||||
bottom:100upx;
|
||||
left: 34upx;
|
||||
}
|
||||
}
|
||||
.cache_right{
|
||||
margin-right: 60upx;
|
||||
}
|
||||
</style>
|
||||
312
金壶/appV1/pages/my/user-path-add.vue
Normal file
312
金壶/appV1/pages/my/user-path-add.vue
Normal file
@@ -0,0 +1,312 @@
|
||||
<template>
|
||||
<!-- 新增地址 -->
|
||||
<view class="content w-100 h-100">
|
||||
<HeaderTop page_title='新增地址'></HeaderTop>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
收货人:</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.consignee" />
|
||||
</view>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark ">
|
||||
手机号码:</view>
|
||||
<input class="px-1 font-md flex-1" type="number" v-model="form.tel" />
|
||||
</view>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom" @click="chooseAera()">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
请选择:{{all_area}}</view>
|
||||
</view>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
详细地址:</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.address" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="p-2 d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
设为默认地址:</view>
|
||||
<switch class="ml-auto" @change="switch2Change" />
|
||||
</view>
|
||||
<text class="pt-0 p-2 d-flex a-center bg-white text-danger">
|
||||
每次下单默认推荐使用该地址</text>
|
||||
|
||||
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 editBtn w-90" style="line-height: 80upx;" @click="submit()">
|
||||
确认
|
||||
</view>
|
||||
|
||||
<!-- 选择地区遮挡层 -->
|
||||
<view class="region w-100 h-100 " v-if='show_Aera==true'>
|
||||
<view class="region_box w-100 padding-30">
|
||||
<view class="d-flex j-sb region_top">
|
||||
<view @click="cancel()">取消</view>
|
||||
<view @click="sure()">确定</view>
|
||||
</view>
|
||||
<view class="region_list d-flex j-sb">
|
||||
<view class="region_item">
|
||||
<view v-for='(item,index) of sheng' :key='index' @click="choose_sheng(index)" :class="{active:sheng_index==index}">{{item.area_name}}</view>
|
||||
</view>
|
||||
<view class="region_item">
|
||||
<view v-for='(item,index) of shi_arr' :key='index' @click="choose_shi(index)" :class="{active:shi_index==index}">{{item.area_name}}</view>
|
||||
</view>
|
||||
<view class="region_item">
|
||||
<view v-for='(item,index) of qu_arr' :key='index' @click="choose_qu(index)" :class="{active:qu_index==index}">{{item.area_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapActions
|
||||
} from "vuex"
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
import shippingAddress from '../../utils/models/shop.js'
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
all_area: '',
|
||||
sheng: [],
|
||||
shi: [],
|
||||
shi_arr: [],
|
||||
qu: [],
|
||||
qu_arr: [],
|
||||
sheng_index: 0,
|
||||
shi_index: 0,
|
||||
qu_index: 0,
|
||||
is_show: false,
|
||||
is_checked: false,
|
||||
// 测试修改id,区县id
|
||||
|
||||
addAddress_id: '', //新增时传入默认地址
|
||||
address_item: '', // 传参地址对象
|
||||
area_id: '',
|
||||
xian_id: '',
|
||||
is_id: '',
|
||||
|
||||
isedit: true,
|
||||
themeColor: '#007AFF',
|
||||
pickerValue: [0, 0, 1],
|
||||
index: -1,
|
||||
show_Aera: false,
|
||||
form: {
|
||||
address: '',
|
||||
id: '',
|
||||
consignee: '',
|
||||
tel: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 是否选择默认
|
||||
switch2Change(e) {
|
||||
this.is_checked = e.target.value
|
||||
|
||||
},
|
||||
// 选择县、区
|
||||
choose_qu(index) {
|
||||
this.qu_index = index
|
||||
this.xian_id = this.qu_arr[index].id
|
||||
},
|
||||
// 选择市
|
||||
choose_shi(index) {
|
||||
this.shi_index = index
|
||||
this.qu_arr = [];
|
||||
this.qu.forEach(item => {
|
||||
if (this.shi_arr[this.shi_index].id == item.parent_area_id) {
|
||||
this.qu_arr.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择省
|
||||
choose_sheng(index) {
|
||||
this.sheng_index = index
|
||||
this.shi_arr = [];
|
||||
this.shi.forEach(item => {
|
||||
if (item.parent_area_id == this.sheng[index].id) {
|
||||
this.shi_arr.push(item)
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
//选择地区
|
||||
chooseAera() {
|
||||
this.show_Aera = !this.show_Aera
|
||||
this.chooseAeraList()
|
||||
},
|
||||
// 新增地址
|
||||
sure() {
|
||||
this.show_Aera = false
|
||||
if (this.sheng[this.sheng_index].area_name == '' || this.shi_arr[this.shi_index].area_name == '' || this.qu_arr[
|
||||
this.qu_index].area_name == '') {
|
||||
uni.showToast({
|
||||
title: '请选择所在地区'
|
||||
});
|
||||
} else {
|
||||
this.area_id = this.qu_arr[this.qu_index].id
|
||||
|
||||
this.all_area = this.sheng[this.sheng_index].area_name + '-' + this.shi_arr[this.shi_index].area_name + '-' + this
|
||||
.qu_arr[this.qu_index].area_name
|
||||
}
|
||||
},
|
||||
// 取消
|
||||
cancel() {
|
||||
this.show_Aera = false
|
||||
},
|
||||
//地区列表
|
||||
async chooseAeraList() {
|
||||
let res = await shippingAddress.shippingAddress();
|
||||
this.handleError(res, res => {
|
||||
for (let i in res.data) {
|
||||
var item = res.data[i]
|
||||
if (item.id && !item.parent_area_id && !item.grand_pa_id) {
|
||||
this.sheng.push(item)
|
||||
}
|
||||
if (item.id && item.parent_area_id && !item.grand_pa_id) {
|
||||
this.shi.push(item)
|
||||
}
|
||||
if (item.id && item.parent_area_id && item.grand_pa_id) {
|
||||
this.qu.push(item)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 提交
|
||||
// 增加地址数据
|
||||
async submit() {
|
||||
if(this.form.tel=='' || this.form.consignee=='' || this.all_area=='' || this.form.address==''){
|
||||
uni.showToast({
|
||||
title: '请完善信息',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
verification.isPhone(this.form.tel); // 手机号格式验证
|
||||
if (verification.isPhone.prototype.the_isPhone !== true) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
let res = await shippingAddress.makeChangeAddress(
|
||||
this.area_id, //区县id
|
||||
this.form.address,
|
||||
this.form.id, //id地址id
|
||||
this.form.consignee,
|
||||
this.form.tel
|
||||
);
|
||||
|
||||
this.is_id = res.data.data.id
|
||||
if (this.is_checked == true) {
|
||||
this.is_defaultAddress()
|
||||
}
|
||||
|
||||
this.handleError(res, res => {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.redirectTo({
|
||||
url: './user-path-list'
|
||||
})
|
||||
}, 500);
|
||||
})
|
||||
},
|
||||
// defaultAddress
|
||||
async is_defaultAddress() {
|
||||
let res = await shippingAddress.defaultAddress(this.is_id)
|
||||
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
.editBtn {
|
||||
position: absolute;
|
||||
bottom: 100upx;
|
||||
left: 34upx;
|
||||
}
|
||||
|
||||
.region {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
.region_box {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
height: 600upx;
|
||||
|
||||
.region_top {
|
||||
line-height: 70upx;
|
||||
height: 70upx;
|
||||
}
|
||||
|
||||
.region_list {
|
||||
|
||||
line-height: 90upx;
|
||||
height: calc(100% - 70upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.region_item {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
color: #b2b2b2;
|
||||
width: 33.3%;
|
||||
text-align: center;
|
||||
|
||||
.active {
|
||||
color: #6E67FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
356
金壶/appV1/pages/my/user-path-edit.vue
Normal file
356
金壶/appV1/pages/my/user-path-edit.vue
Normal file
@@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<!-- 修改地址 -->
|
||||
<view class="content w-100 h-100">
|
||||
<HeaderTop page_title='修改地址'></HeaderTop>
|
||||
<view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
收货人:</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.consignee" />
|
||||
</view>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark ">
|
||||
手机号码:</view>
|
||||
<input class="px-1 font-md flex-1" type="number" v-model="form.tel" />
|
||||
</view>
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom" @click="chooseAera()">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
请选择:{{all_area}}</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- <view class="p-2 border-bottom d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
所在地区:</view>
|
||||
<input class="px-1 font-md flex-1" type="text" disabled
|
||||
@click="showMulLinkageThreePicker" placeholder="请选择所在地区"
|
||||
:value="form.path"/>
|
||||
|
||||
<mpvue-city-picker :themeColor="themeColor" ref="mpvueCityPicker" :pickerValueDefault="pickerValue" @onConfirm="onConfirm"></mpvue-city-picker>
|
||||
|
||||
</view> -->
|
||||
<view class="p-2 d-flex a-center bg-white border-bottom">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
详细地址:</view>
|
||||
<input class="px-1 font-md flex-1" type="text" v-model="form.address" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="p-2 d-flex a-center bg-white">
|
||||
<view class="font-md text-secondary mr-1 flex-shrink text-dark">
|
||||
设为默认地址:</view>
|
||||
<switch class="ml-auto" @change="switch2Change" :checked="is_checked" />
|
||||
</view>
|
||||
<text class="pt-0 p-2 d-flex a-center bg-white text-danger">
|
||||
每次下单默认推荐使用该地址</text>
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 editBtn w-90" style="line-height: 80upx;" @click="submit()">确认</view>
|
||||
<!-- <view class="x_public_box x-text-white x-bg-159 margin-shu20" style="line-height: 80upx;" @click="del_address()">删除地址</view> -->
|
||||
|
||||
<!-- <view class="p-3">
|
||||
<view class="text-center w-100 bg-danger text-white font-md rounded py-2" hover-class="main-bg-hover-color" @click="submit">
|
||||
确认
|
||||
</view>
|
||||
<view class="text-center w-100 bg-danger text-white font-md rounded py-2 margin-shu20" hover-class="main-bg-hover-color" @click="del_address()">
|
||||
删除地址
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 选择地区遮挡层 -->
|
||||
<view class="region w-100 h-100 " v-if='show_Aera==true'>
|
||||
<view class="region_box w-100 padding-30">
|
||||
<view class="d-flex j-sb region_top">
|
||||
<view @click="cancel()">取消</view>
|
||||
<view @click="sure()">确定</view>
|
||||
</view>
|
||||
<view class="region_list d-flex j-sb">
|
||||
<view class="region_item">
|
||||
<view v-for='(item,index) of sheng' :key='index' @click="choose_sheng(index)" :class="{active:sheng_index==index}">{{item.area_name}}</view>
|
||||
</view>
|
||||
<view class="region_item">
|
||||
<view v-for='(item,index) of shi_arr' :key='index' @click="choose_shi(index)" :class="{active:shi_index==index}">{{item.area_name}}</view>
|
||||
</view>
|
||||
<view class="region_item">
|
||||
<view v-for='(item,index) of qu_arr' :key='index' @click="choose_qu(index)" :class="{active:qu_index==index}">{{item.area_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {
|
||||
mapActions
|
||||
} from "vuex"
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
import shippingAddress from '../../utils/models/shop.js'
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
all_area:'',
|
||||
sheng: [],
|
||||
shi: [],
|
||||
shi_arr:[],
|
||||
qu: [],
|
||||
qu_arr:[],
|
||||
sheng_index :0,
|
||||
shi_index:0,
|
||||
qu_index:0,
|
||||
is_show:false,
|
||||
is_checked:false,
|
||||
// 测试修改id,区县id
|
||||
addAddress_id: '', //新增时传入默认地址
|
||||
address_item: '', // 传参地址对象
|
||||
area_id: 2,
|
||||
xian_id:'',
|
||||
|
||||
|
||||
isedit: true,
|
||||
themeColor: '#007AFF',
|
||||
pickerValue: [0, 0, 1],
|
||||
index: -1,
|
||||
show_Aera: false,
|
||||
form: ''
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
this.form = option.address_item
|
||||
if(JSON.parse(option.address_item).is_default!=0){
|
||||
this.is_checked = true
|
||||
}else{
|
||||
this.is_checked = false
|
||||
}
|
||||
|
||||
if(this.form==''){
|
||||
|
||||
}else{
|
||||
this.form = JSON.parse(this.form)
|
||||
this.all_area = this.form.area_name
|
||||
this.id = this.form.id
|
||||
}
|
||||
},
|
||||
// 监听返回
|
||||
onBackPress() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapActions(['updatePathAction', 'createPathAction']),
|
||||
// 是否选择默认
|
||||
switch2Change(e){
|
||||
this.is_checked = e.target.value
|
||||
},
|
||||
// 删除地址
|
||||
async del_address(){
|
||||
let res = await shippingAddress.deleteAddress(this.form.id);
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.redirectTo({
|
||||
url:'./user-path-list'
|
||||
})
|
||||
}, 1000);
|
||||
},
|
||||
// id_moren
|
||||
id_moren(){
|
||||
this.is_show = !this.is_show
|
||||
},
|
||||
// 选择县、区
|
||||
choose_qu(index){
|
||||
this.qu_index = index
|
||||
this.xian_id = this.qu_arr[index].id
|
||||
},
|
||||
// 选择市
|
||||
choose_shi(index){
|
||||
this.shi_index = index
|
||||
this.qu_arr = [];
|
||||
this.qu.forEach(item=>{
|
||||
if(this.shi_arr[this.shi_index].id == item.parent_area_id){
|
||||
this.qu_arr.push(item)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择省
|
||||
choose_sheng(index){
|
||||
this.sheng_index = index
|
||||
|
||||
this.shi_arr = [];
|
||||
this.shi.forEach(item=>{
|
||||
if(item.parent_area_id == this.sheng[index].id){
|
||||
this.shi_arr.push(item)
|
||||
// console.log(this.shi_arr,'shi')
|
||||
}
|
||||
})
|
||||
},
|
||||
//选择地区
|
||||
chooseAera() {
|
||||
this.show_Aera = !this.show_Aera
|
||||
this.chooseAeraList()
|
||||
},
|
||||
sure(){
|
||||
this.show_Aera = false
|
||||
if(this.sheng[this.sheng_index].area_name=='' || this.shi_arr[this.shi_index].area_name=='' || this.qu_arr[this.qu_index].area_name==''){
|
||||
uni.showToast({
|
||||
title: '请选择所在地区',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}else{
|
||||
this.all_area = this.sheng[this.sheng_index].area_name + '-' +this.shi_arr[this.shi_index].area_name + '-' + this.qu_arr[this.qu_index].area_name
|
||||
}
|
||||
},
|
||||
// 取消
|
||||
cancel(){
|
||||
this.show_Aera = false
|
||||
},
|
||||
//地区列表
|
||||
async chooseAeraList() {
|
||||
let res = await shippingAddress.shippingAddress();
|
||||
this.handleError(res, res => {
|
||||
for (let i in res.data) {
|
||||
var item = res.data[i]
|
||||
if (item.id && !item.parent_area_id && !item.grand_pa_id) {
|
||||
this.sheng.push(item)
|
||||
}
|
||||
if (item.id && item.parent_area_id && !item.grand_pa_id) {
|
||||
this.shi.push(item)
|
||||
}
|
||||
if (item.id && item.parent_area_id && item.grand_pa_id) {
|
||||
this.qu.push(item)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// defaultAddress 是否设置成默认地址
|
||||
async is_defaultAddress(){
|
||||
let res = await shippingAddress.defaultAddress(this.is_id)
|
||||
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 增加地址数据
|
||||
async submit() {
|
||||
|
||||
verification.isPhone(this.form.tel); // 手机号格式验证
|
||||
if (verification.isPhone.prototype.the_isPhone !== true) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的手机号',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
let res = await shippingAddress.makeChangeAddress(
|
||||
this.form.area_id, //区县id
|
||||
this.form.address,
|
||||
this.form.id, //id地址id
|
||||
this.form.consignee,
|
||||
this.form.tel
|
||||
);
|
||||
this.is_id = res.data.data.id
|
||||
if(this.is_checked==true){
|
||||
this.is_defaultAddress()
|
||||
}
|
||||
setTimeout(function() {
|
||||
uni.redirectTo({
|
||||
url:'./user-path-list'
|
||||
})
|
||||
// uni.navigateTo({
|
||||
// url:'./user-path-list'
|
||||
// })
|
||||
}, 500);
|
||||
this.handleError(res, res => {
|
||||
this.addAddress_id = res.data.data.id
|
||||
})
|
||||
},
|
||||
// 三级联动确定
|
||||
onConfirm(e) {
|
||||
this.form.path = e.label
|
||||
this.pickerValue = e.value
|
||||
},
|
||||
// 显示三级联动选择
|
||||
showMulLinkageThreePicker() {
|
||||
this.$refs.mpvueCityPicker.show()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
.region {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
.region_box {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-color: #FFFFFF;
|
||||
|
||||
height: 600upx;
|
||||
|
||||
.region_top {
|
||||
line-height: 70upx;
|
||||
height: 70upx;
|
||||
}
|
||||
|
||||
.region_list {
|
||||
|
||||
line-height: 90upx;
|
||||
height: calc(100% - 70upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.region_item {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
color: #b2b2b2;
|
||||
width: 33.3%;
|
||||
text-align: center;
|
||||
.active{
|
||||
color:#6E67FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.editBtn{
|
||||
position: absolute;
|
||||
bottom:100upx;
|
||||
left: 34upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
260
金壶/appV1/pages/my/user-path-list.vue
Normal file
260
金壶/appV1/pages/my/user-path-list.vue
Normal file
@@ -0,0 +1,260 @@
|
||||
<template>
|
||||
<!-- 收货地址 -->
|
||||
<view class="w-100 h-100 all">
|
||||
<HeaderTop page_title='收货地址'></HeaderTop>
|
||||
<view class="list">
|
||||
<view class="list_item d-flex j-sb j-center a-center padding-30 border-bottom" v-for="(item,index) in dataList" :key="index" @click="chooseadd(index)">
|
||||
<!-- <radio value="" :checked="item.checked" style="width:10%;" v-if="goods_id!=''" /> -->
|
||||
<view class="items_info flex-1 padding-zy30">
|
||||
<view class="d-flex">
|
||||
<view>{{item.consignee}}</view>
|
||||
<view class='margin-zy20'>{{item.tel}}</view>
|
||||
<view class="is_choose margin-zy20" v-if='item.is_default!=0'>默认</view>
|
||||
</view>
|
||||
<view>
|
||||
{{item.address}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view style="10%;" @click.stop="edit(index)">编辑</view> -->
|
||||
<image src="../../static/shoppingCart/edit1.png" mode="" style="height:40upx; width:40upx;margin-right: 30upx;" @click.stop="edit(index)"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <block v-for="(item,index) in dataList" :key="index">
|
||||
<uni-swipe-action :options="options"
|
||||
@click="bindClick($event,index)">
|
||||
<uni-list-item @click="choose(item)">
|
||||
<view class="text-secondary text-dark">
|
||||
<view class="d-flex a-center">
|
||||
<text class="text-dark mr-2 font-weight">{{item.consignee}}</text>
|
||||
{{item.tel}}
|
||||
<text class="main-text-color ml-2"
|
||||
v-if="item.isdefault">[默认]</text>
|
||||
</view>
|
||||
<view>{{item.area_name}} {{"("}}{{item.address}}{{")"}}</view>
|
||||
</view>
|
||||
</uni-list-item>
|
||||
</uni-swipe-action>
|
||||
</block> -->
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 shadow addBtn w-90" style="line-height: 80upx;" @click="addPath()">新增收货地址</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from '@/store/index.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import uniListItem from "@/components/uni-ui/uni-list-item/uni-list-item.vue"
|
||||
import uniSwipeAction from "@/components/uni-ui/uni-swipe-action/uni-swipe-action.vue"
|
||||
import {mapState,mapMutations} from "vuex"
|
||||
|
||||
import shippingAddress from '../../utils/models/shop.js'
|
||||
export default {
|
||||
components: {
|
||||
uniListItem,
|
||||
uniSwipeAction,
|
||||
HeaderTop
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
address_id:'',
|
||||
goods_id:'',
|
||||
dataList:[], //数据列表
|
||||
|
||||
isChoose:false,
|
||||
options: [{
|
||||
text: '编辑',
|
||||
style: {
|
||||
backgroundColor: '#007aff'
|
||||
}
|
||||
}, {
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#dd524d'
|
||||
}
|
||||
}],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
list:state=>state.path.list
|
||||
}),
|
||||
},
|
||||
// // 监听导航栏按钮点击
|
||||
// onNavigationBarButtonTap(e) {
|
||||
// if(e.index === 0){
|
||||
// uni.navigateTo({
|
||||
// url: '../my/user-path-edit'
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
onLoad(option) {
|
||||
if (option.type === '') {
|
||||
this.isChoose = true
|
||||
}
|
||||
if(option.goods_id){
|
||||
|
||||
this.goods_id = option.goods_id
|
||||
|
||||
}
|
||||
// 请求数据
|
||||
this.getData()
|
||||
},
|
||||
// 默认返回
|
||||
onBackPress(options) {
|
||||
if (options.from === 'backbutton') {
|
||||
uni.navigateTo({
|
||||
url: '../../pages/order/index?is_index=1',
|
||||
});
|
||||
}
|
||||
return true
|
||||
},
|
||||
methods: {
|
||||
// 编辑地址
|
||||
edit(index){
|
||||
// console.log(this.goods_id)
|
||||
uni.redirectTo({
|
||||
url:'./user-path-edit?address_item='+JSON.stringify(this.dataList[index])
|
||||
})
|
||||
console.log(JSON.stringify(this.dataList[index]));
|
||||
|
||||
// {"id":286,
|
||||
// "area_id":216,
|
||||
// "address":"aeawef",
|
||||
// "consignee":"天空",
|
||||
// "tel":"1565654848",
|
||||
// "is_default":0,
|
||||
// "area_name":"河南省 - 洛阳市 - 嵩县",
|
||||
// "short_consignee":"天空",
|
||||
// "checked":fals,
|
||||
// }
|
||||
},
|
||||
// 选择地址
|
||||
chooseadd(index){
|
||||
this.goods_id = this.$store.state.goods_id;
|
||||
if(this.goods_id ==''){
|
||||
console.log(1111)
|
||||
}else{
|
||||
this.dataList[index].checked = !this.dataList[index].checked
|
||||
uni.navigateTo({
|
||||
url:'../shoppingCart/sureOrder?goods_id='+this.goods_id+'&address='+JSON.stringify(this.dataList[index])
|
||||
})
|
||||
}
|
||||
},
|
||||
// 地址列表
|
||||
async getData(){
|
||||
let res = await shippingAddress.addressList();
|
||||
this.handleError(res, res => {
|
||||
|
||||
this.dataList = res.data.data.list
|
||||
|
||||
|
||||
this.dataList.forEach(item=>{
|
||||
|
||||
item.checked = false
|
||||
this.address_id = item.id
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
async deletelist(){
|
||||
let res = await shippingAddress.deleteAddress(this.address_id);
|
||||
this.handleError(res, res => {
|
||||
|
||||
if(res.code == 200){
|
||||
uni.showToast({
|
||||
title:'删除成功'
|
||||
})
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
async bindClick(value,i) {
|
||||
let res;
|
||||
switch (value.index){
|
||||
case 0: // 修改
|
||||
let obj = JSON.stringify({
|
||||
index:i,
|
||||
item:this.address_id
|
||||
})
|
||||
setTimeout(()=> {
|
||||
uni.redirectTo({
|
||||
url: '../my/user-path-edit?data='+obj,
|
||||
});
|
||||
},50);
|
||||
break;
|
||||
case 1: // 删除
|
||||
let res = await shippingAddress.deleteAddress(this.address_id);
|
||||
this.handleError(res, res => {
|
||||
|
||||
if(res.code == 200){
|
||||
uni.showModal({
|
||||
content: '要删除该收货地址吗?',
|
||||
success(res){
|
||||
if(res.confirm){
|
||||
uni.showToast({
|
||||
title:'删除成功'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}else{
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 选择收货地址
|
||||
choose(item){
|
||||
if (this.isChoose) {
|
||||
// 通知订单提交页修改收货地址
|
||||
uni.$emit('choosePath',item)
|
||||
// 关闭当前页面
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
},
|
||||
// 新增地址
|
||||
addPath() {
|
||||
uni.redirectTo({
|
||||
url: '../my/user-path-add'
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.is_choose{
|
||||
background-color: #EDCA4A;
|
||||
color: #FFFFFF;
|
||||
height:50upx;
|
||||
line-height: 50upx;
|
||||
padding: 0 15upx;
|
||||
font-size: 28upx;
|
||||
border-radius: 20upx;
|
||||
}
|
||||
.list{
|
||||
height:calc(100% - 300upx);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.addBtn{
|
||||
position: absolute;
|
||||
bottom:0upx;
|
||||
left: 34upx;
|
||||
}
|
||||
|
||||
</style>
|
||||
390
金壶/appV1/pages/my/x_login.vue
Normal file
390
金壶/appV1/pages/my/x_login.vue
Normal file
@@ -0,0 +1,390 @@
|
||||
<template>
|
||||
<!-- 登录 页面 -->
|
||||
<view class="content h-100">
|
||||
<view class="banner">
|
||||
<!-- <image src="../../static/my/left.png" mode="" class="back" @click="goBack()"></image> -->
|
||||
<view v-if="login_flag" class="page_title text-center x-text-white" >登录</view>
|
||||
<view v-if="!login_flag" class="page_title text-center x-text-white">注册</view>
|
||||
</view>
|
||||
<view class="my_form padding-zy64">
|
||||
<view class="my_form_menu d-flex">
|
||||
<view class="menu_items" @click="chooseMenu(index)" :class="{menu_active: menu_index==index}" v-for="(item,index) of form_menu" :key='index'>{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 登录表单 -->
|
||||
<view class="uni-common-mt my_input" v-if="menu_index==0">
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/phone.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input h-100 flex-1" type="text" cursor-spacing="20" focus placeholder="请输入手机号" v-model="phone"/>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/suo.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input flex-1 mima" cursor-spacing="20" :type="is_type" placeholder="请输入密码" v-model="password"/>
|
||||
<image src="../../static/my/bukan.png" mode="" class="is_seen" v-if="seen==false" @tap='change_seen()'></image>
|
||||
<image src="../../static/my/kan.png" mode="" class="is_seen1" v-if="seen==true" @tap='change_seen()'></image>
|
||||
</view>
|
||||
<button class="public_blue_btn login" @click="toLogin()">登录</button>
|
||||
<text class="forget_password" @click="forget_password()">忘记密码?</text>
|
||||
</view>
|
||||
<!-- 注册表单 -->
|
||||
<view class="uni-common-mt my_input" v-if="menu_index==1">
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/phone.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input h-100 flex-1" type="number" focus placeholder="请输入手机号" v-model="phone"/>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/loginadd.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input flex-1" type="number" placeholder="验证码" v-model="code" />
|
||||
<view class="get_code x-text-red x-text-font24 text-right" v-if="get_code==false" @click="getCode()">获取验证码</view>
|
||||
<view class="get_code x-text-red x-text-font24 w-50 text-right" v-else>{{count_time}}s后再次获取验证码</view>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center j-sb">
|
||||
<image src="../../static/my/suo.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input flex-1" :type="is_RseenType" placeholder="请设置密码" v-model="new_password" />
|
||||
<image src="../../static/my/bukan.png" mode="" class="is_seen" v-if="Rseen==false" @tap='change_Rseen()'></image>
|
||||
<image src="../../static/my/kan.png" mode="" class="is_seen1" v-if="Rseen==true" @tap='change_Rseen()'></image>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center j-sb">
|
||||
<image src="../../static/my/suo.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input flex-1" :type="is_rseenType" placeholder="确认密码" v-model="sure_password" />
|
||||
<image src="../../static/my/bukan.png" mode="" class="is_seen" v-if="rseen==false" @tap='change_rseen()'></image>
|
||||
<image src="../../static/my/kan.png" mode="" class="is_seen1" v-if="rseen==true" @tap='change_rseen()'></image>
|
||||
</view>
|
||||
<!-- <view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/phone.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input h-100 flex-1" type="number" focus placeholder="客服编号(选填)" v-model="kefu_num"/>
|
||||
</view> -->
|
||||
<button class="public_blue_btn login" @click="the_register()">注册</button>
|
||||
<view class="agree d-flex">
|
||||
<view>点击“注册”即表示您已阅读并同意</view>
|
||||
<view class="x-text-red" @tap='look_Explain()'>《医点医滴会员服务协议》</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
import public_function from '../../common/public_function.js' //公用方法
|
||||
import X_login from '../../utils/models/x_login.js'
|
||||
import {http_use,http_post} from '../../utils/http.js'
|
||||
import {Config} from '../../utils/config.js'
|
||||
import md5 from '../../common/ossutil/md5.min.js'
|
||||
let Base64 = require('../../common/ossutil/base64.js');
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
seen:false,
|
||||
Rseen:false,
|
||||
rseen:false,
|
||||
login_flag:true,
|
||||
is_type:'password',
|
||||
is_RseenType:'password',
|
||||
is_rseenType:'password',
|
||||
Base64:'',
|
||||
phone:'',
|
||||
password:'',
|
||||
form_menu:[{
|
||||
name:'登录',
|
||||
id:0
|
||||
},{
|
||||
name:'注册',
|
||||
id:1
|
||||
}],
|
||||
menu_index:0,
|
||||
get_code: false, //判断是否点击了“获取验证码”按钮 是:true ; 否:false
|
||||
code: '', // 验证码
|
||||
new_password: '',
|
||||
sure_password: '',
|
||||
count_time: 60,
|
||||
now_time:'',// 当前时间戳
|
||||
is_sign:'' //签名
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.Base64 = Base64;
|
||||
|
||||
},
|
||||
methods: {
|
||||
// look_Explain
|
||||
look_Explain(){
|
||||
uni.navigateTo({
|
||||
url:'./explain'
|
||||
})
|
||||
},
|
||||
// 返回
|
||||
goBack(){
|
||||
uni.switchTab({
|
||||
url: '/pages/home/home'
|
||||
});
|
||||
},
|
||||
change_rseen(){
|
||||
this.rseen = !this.rseen
|
||||
|
||||
if(this.rseen == true){
|
||||
this.is_rseenType = 'text'
|
||||
|
||||
}else{
|
||||
this.is_rseenType = 'password'
|
||||
|
||||
}
|
||||
},
|
||||
change_Rseen(){
|
||||
this.Rseen = !this.Rseen
|
||||
|
||||
if(this.Rseen == true){
|
||||
this.is_RseenType = 'text'
|
||||
|
||||
}else{
|
||||
this.is_RseenType = 'password'
|
||||
|
||||
}
|
||||
},
|
||||
// 密码内容是否可见
|
||||
change_seen(){
|
||||
this.seen = !this.seen
|
||||
if(this.seen == true){
|
||||
this.is_type = 'text'
|
||||
|
||||
}else{
|
||||
this.is_type = 'password'
|
||||
|
||||
}
|
||||
},
|
||||
// 注册
|
||||
async the_register(){
|
||||
verification.isNull(this.phone, this.code, this.new_password, this.sure_password) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
verification.isPhone(this.phone); // 手机号格式验证
|
||||
}
|
||||
if (verification.isPhone.prototype.the_isPhone == true) {
|
||||
verification.isSamePsd(this.new_password, this.sure_password); // 两次密码是否相同
|
||||
}
|
||||
if(this.new_password.length<6){
|
||||
uni.showToast({
|
||||
title: '请输入至少6位密码',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
verification.isNull.prototype.the_Null == true &&
|
||||
verification.isPhone.prototype.the_isPhone == true &&
|
||||
verification.isSamePsd.prototype.the_isSamePsd == true &&
|
||||
this.new_password.length>=6
|
||||
) {
|
||||
|
||||
|
||||
|
||||
let res = await X_login.x_register(this.phone, this.code,this.new_password)
|
||||
if(res.code ==200){
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.password = this.new_password
|
||||
|
||||
|
||||
this.toLogin();
|
||||
// setTimeout(function() {
|
||||
// this.menu_index = 0
|
||||
// }, 1000);
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
|
||||
|
||||
})
|
||||
return
|
||||
uni.navigateTo({
|
||||
url: 'authentication'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 获取验证码
|
||||
async getCode() {
|
||||
verification.isPhone(this.phone);
|
||||
if(verification.isPhone.prototype.the_isPhone == true){
|
||||
let res = await X_login.phonecode_app(this.phone, this.code,1)
|
||||
if(res.data.errcode==-1){
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}else{
|
||||
this.get_code = !this.get_code
|
||||
this.timer();
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
// 验证码计时器
|
||||
timer() {
|
||||
if (this.count_time > 0) {
|
||||
this.count_time--;
|
||||
this.get_code = true
|
||||
setTimeout(this.timer, 1000);
|
||||
} else {
|
||||
this.count_time = 60;
|
||||
this.get_code = false
|
||||
|
||||
}
|
||||
},
|
||||
// 选择菜单(登录或者注册)
|
||||
chooseMenu(index){
|
||||
// 解决登录 或 注册 重复点击标题切换
|
||||
if (this.menu_index != index){
|
||||
this.menu_index = index;
|
||||
this.login_flag = !this.login_flag
|
||||
}
|
||||
},
|
||||
// 登录
|
||||
async toLogin(){
|
||||
verification.isNull(this.phone, this.password) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
verification.isUniCode(this.phone); // 判断是否出现汉字
|
||||
}
|
||||
if(this.password.length<6){
|
||||
uni.showToast({
|
||||
title: '请输入至少6位密码',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
verification.isNull.prototype.the_Null == true &&
|
||||
verification.isUniCode.prototype.the_isUniCode == true &&
|
||||
this.password.length>=6
|
||||
) {
|
||||
this.now_time = (Date.parse(new Date()))/1000; //获取当前时间戳
|
||||
this.is_sign = md5('123456' + 'test' + this.phone + md5(this.password) + this.now_time) //签名
|
||||
let res = await X_login.login(this.phone, this.password,'test',this.now_time,this.is_sign)
|
||||
this.handleError(res, res => {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
Config.appid = res.data.client.appid; // appid
|
||||
Config.uid = res.data.client.id; // uid
|
||||
Config.access_token = res.data.access_token; // access_token
|
||||
Config.refresh_token = res.data.refresh_token; // refresh_token
|
||||
// 使用base64把字符串加密
|
||||
Config.authentication = "USERID " + Base64.encode(Config.appid + '-' + Config.uid + '-' + Config.access_token + '-' + Config.refresh_token);
|
||||
|
||||
uni.setStorage({
|
||||
key: 'isAuthentication',
|
||||
data: Config.authentication,
|
||||
success: function () {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: '../home/home'
|
||||
})
|
||||
}, 500);
|
||||
})
|
||||
}
|
||||
},
|
||||
// 忘记密码
|
||||
forget_password(){
|
||||
uni.navigateTo({
|
||||
url: 'x_reset_assword'
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.banner{
|
||||
height:404upx;
|
||||
padding-top:60upx;
|
||||
position: relative;
|
||||
background-image: url(../../static/my/login.png);
|
||||
background-position: 100% 100%;
|
||||
background-size: cover;
|
||||
border:none;
|
||||
outline: none;
|
||||
.page_title{
|
||||
font-size: 32upx;
|
||||
}
|
||||
.back{
|
||||
position: absolute;
|
||||
top:100upx;
|
||||
left:33upx;
|
||||
height:31upx;
|
||||
width:19upx;
|
||||
}
|
||||
}
|
||||
.login{
|
||||
margin-top:60upx;
|
||||
}
|
||||
.my_form{
|
||||
.my_form_menu{
|
||||
.menu_items{
|
||||
margin-right:44upx;
|
||||
}
|
||||
}
|
||||
.menu_active{
|
||||
color: #282828;
|
||||
font-size: 32upx;
|
||||
border-bottom:4upx solid #6B68DC;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.my_input{
|
||||
padding:100upx 64upx;
|
||||
.two_input{
|
||||
border-bottom:1upx solid #F2F2F2;
|
||||
height:100upx;
|
||||
.uni-input{
|
||||
border:none;
|
||||
outline: none;
|
||||
padding-left:20upx;
|
||||
|
||||
}
|
||||
.is_seen{
|
||||
|
||||
height:20upx;
|
||||
width:47upx;
|
||||
}
|
||||
.is_seen1{
|
||||
|
||||
height:30upx;
|
||||
width:47upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.forget_password{
|
||||
display: inline-block;
|
||||
margin:15upx 0;
|
||||
color: #6B6AD5;
|
||||
border-bottom: 1upx solid #6B6AD5;
|
||||
}
|
||||
.agree {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
white-space: normal !important;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical
|
||||
}
|
||||
}
|
||||
</style>
|
||||
123
金壶/appV1/pages/my/x_register.vue
Normal file
123
金壶/appV1/pages/my/x_register.vue
Normal file
@@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<!-- 注册 页面 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='注cc册'></HeaderTop>
|
||||
<view class="uni-common-mt">
|
||||
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
||||
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
||||
<input class="uni-input" type="number" focus placeholder="请输入手机号" v-model="phone" />
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
||||
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
||||
<input class="uni-input flex-1" type="number" placeholder="验证码" v-model="code" />
|
||||
<view class="get_code x-text-red x-text-font24" v-if="get_code==false" @click="getCode()">获取验证码</view>
|
||||
<view class="get_code x-text-red x-text-font24 w-50" v-else>{{count_time}}s后再次获取验证码</view>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
||||
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
||||
<input class="uni-input" type="password" placeholder="请设置密码" v-model="new_password" />
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex w-526 x_margin0auto">
|
||||
<image src="../../static/1000.jpg" mode="" class="w-38 h-38"></image>
|
||||
<input class="uni-input" type="password" placeholder="确认密码" v-model="sure_password" />
|
||||
</view>
|
||||
</view>
|
||||
<button class="public_blue_btn sure w-90 bg-linear-gradient" @click="sure()">注册</button>
|
||||
<view class="agree">点击“注册”即表示您已阅读并同意<text class="x-text-red">《医点医滴会员服务协议》</text></view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import {http_use,http_post} from '../../utils/http.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
get_code: false,
|
||||
count_time: 60,
|
||||
phone: '',
|
||||
code: '',
|
||||
new_password: '',
|
||||
sure_password: '',
|
||||
}
|
||||
},
|
||||
comments:{
|
||||
HeaderTop
|
||||
},
|
||||
methods: {
|
||||
// 获取验证码
|
||||
getCode() {
|
||||
this.get_code = !this.get_code
|
||||
this.timer();
|
||||
},
|
||||
// 验证码计时器
|
||||
timer() {
|
||||
if (this.count_time > 0) {
|
||||
this.count_time--;
|
||||
this.get_code = true
|
||||
setTimeout(this.timer, 1000);
|
||||
} else {
|
||||
this.count_time = 60;
|
||||
this.get_code = false
|
||||
|
||||
}
|
||||
},
|
||||
sure() {
|
||||
verification.isNull(this.phone, this.code, this.new_password, this.sure_password) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
verification.isPhone(this.phone); // 手机号格式验证
|
||||
}
|
||||
if (verification.isPhone.prototype.the_isPhone == true) {
|
||||
verification.isSamePsd(this.new_password, this.sure_password); // 两次密码是否相同
|
||||
}
|
||||
|
||||
if (
|
||||
verification.isNull.prototype.the_Null == true &&
|
||||
verification.isPhone.prototype.the_isPhone == true &&
|
||||
verification.isSamePsd.prototype.the_isSamePsd == true
|
||||
) {
|
||||
uni.navigateTo({
|
||||
url: 'authentication'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
|
||||
|
||||
.uni-common-mt {
|
||||
|
||||
padding: 138upx 100upx 0 ;
|
||||
|
||||
.uni-form-item {
|
||||
border-bottom: 2upx solid #ECE4E4;
|
||||
padding-top: 60upx;
|
||||
|
||||
.login_icon {
|
||||
margin-right: 40upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.sure {
|
||||
margin-top: 70upx;
|
||||
|
||||
}
|
||||
|
||||
.agree {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
white-space: normal !important;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical
|
||||
}
|
||||
}
|
||||
</style>
|
||||
190
金壶/appV1/pages/my/x_reset_assword.vue
Normal file
190
金壶/appV1/pages/my/x_reset_assword.vue
Normal file
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<!-- 重置密码 页面 -->
|
||||
<view class="content h-100">
|
||||
<view class="banner">
|
||||
<image src="../../static/my/left.png" mode="" class="back" @click="goback()"></image>
|
||||
<view class="page_title text-center x-text-white">重置密码</view>
|
||||
</view>
|
||||
<view class="uni-common-mt my_input">
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/phone.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input h-100 flex-1" type="number" focus placeholder="请输入手机号" v-model="phone"/>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/loginadd.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input flex-1" type="number" placeholder="验证码" v-model="code" />
|
||||
<view class="get_code x-text-red x-text-font24 text-right" v-if="get_code==false" @click="getCode()">获取验证码</view>
|
||||
<view class="get_code x-text-red x-text-font24 w-50 text-right" v-else>{{count_time}}s后再次获取验证码</view>
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/suo.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input" type="password" placeholder="请设置密码" v-model="new_password" />
|
||||
</view>
|
||||
<view class="uni-form-item uni-column d-flex x_margin0auto two_input a-center">
|
||||
<image src="../../static/my/suo.png" mode="" class="w-36 h-41"></image>
|
||||
<input class="uni-input" type="password" placeholder="确认密码" v-model="sure_password" />
|
||||
</view>
|
||||
<button class="public_blue_btn login" @click="sure()">确认修改</button>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import X_login from '../../utils/models/x_login.js'
|
||||
import verification from '../../common/verification.js' //正则验证
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
get_code: false,
|
||||
count_time: 60,
|
||||
phone: '',
|
||||
code: '',
|
||||
new_password: '',
|
||||
sure_password: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取验证码
|
||||
async getCode() {
|
||||
verification.isPhone(this.phone);
|
||||
if(verification.isPhone.prototype.the_isPhone == true){
|
||||
|
||||
let res = await X_login.phonecode_app(this.phone,this.code,2)
|
||||
|
||||
if(res.data.errcode==-14){
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.get_code = !this.get_code
|
||||
this.timer();
|
||||
this.handleError(res, res => {
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
goback(){
|
||||
uni.navigateBack(1)
|
||||
},
|
||||
// getCode() {
|
||||
// this.get_code = !this.get_code
|
||||
// this.timer();
|
||||
// },
|
||||
// 验证码计时器
|
||||
timer() {
|
||||
if (this.count_time > 0) {
|
||||
this.count_time--;
|
||||
this.get_code = true
|
||||
setTimeout(this.timer, 1000);
|
||||
} else {
|
||||
this.count_time = 60;
|
||||
this.get_code = false
|
||||
|
||||
}
|
||||
},
|
||||
// 确认修改
|
||||
async sure() {
|
||||
verification.isNull(this.phone, this.code, this.new_password, this.sure_password) // 非空验证
|
||||
if (verification.isNull.prototype.the_Null == true) {
|
||||
verification.isPhone(this.phone); // 手机号格式验证
|
||||
}
|
||||
if (verification.isPhone.prototype.the_isPhone == true) {
|
||||
verification.isSamePsd(this.new_password, this.sure_password); // 两次密码是否相同
|
||||
}
|
||||
|
||||
if (
|
||||
verification.isNull.prototype.the_Null == true &&
|
||||
verification.isPhone.prototype.the_isPhone == true &&
|
||||
verification.isSamePsd.prototype.the_isSamePsd == true
|
||||
) {
|
||||
let res = await X_login.forgetPassword_app(this.phone, this.code,this.new_password)
|
||||
this.handleError(res, res => {
|
||||
|
||||
uni.navigateTo({
|
||||
url: 'x_login'
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.banner{
|
||||
height:404upx;
|
||||
padding-top:60upx;
|
||||
position: relative;
|
||||
background-image: url(../../static/my/login.png);
|
||||
background-position: 100% 100%;
|
||||
background-size: cover;
|
||||
.page_title{
|
||||
// line-height: 118upx;
|
||||
font-size: 32upx;
|
||||
}
|
||||
.back{
|
||||
position: absolute;
|
||||
top:100upx;
|
||||
left:33upx;
|
||||
height:31upx;
|
||||
width:19upx;
|
||||
}
|
||||
}
|
||||
.login{
|
||||
margin-top:60upx;
|
||||
}
|
||||
.my_form{
|
||||
.my_form_menu{
|
||||
.menu_items{
|
||||
margin-right:44upx;
|
||||
}
|
||||
}
|
||||
.menu_active{
|
||||
color: #282828;
|
||||
font-size: 32upx;
|
||||
border-bottom:4upx solid #6B68DC;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.my_input{
|
||||
padding:100upx 64upx;
|
||||
.two_input{
|
||||
border-bottom:1upx solid #F2F2F2;
|
||||
height:100upx;
|
||||
}
|
||||
}
|
||||
.forget_password{
|
||||
display: inline-block;
|
||||
margin:15upx 0;
|
||||
color: #6B6AD5;
|
||||
border-bottom: 1upx solid #6B6AD5;
|
||||
}
|
||||
.agree {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
white-space: normal !important;
|
||||
text-overflow: ellipsis;
|
||||
word-wrap: break-word;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
金壶/appV1/pages/order/.pydio
Normal file
1
金壶/appV1/pages/order/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
0500806b-2122-44ec-b69f-4215f7411a77
|
||||
309
金壶/appV1/pages/order/details.vue
Normal file
309
金壶/appV1/pages/order/details.vue
Normal file
@@ -0,0 +1,309 @@
|
||||
<template>
|
||||
<!-- 订单详情 页面 -->
|
||||
<view class="content bg_F2F2F2">
|
||||
<PublicTop page_title='订单详情'></PublicTop>
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<!-- 等待收货 -->
|
||||
<view class="banner x-text-white margin-bottom22 banner1">
|
||||
<view class="font-weight is_state">{{orderInfo.order_detail.order_status_str}}</view>
|
||||
<view class="state_txt padding-zy64">收到货后将自动确认订单</view>
|
||||
</view>
|
||||
<view class="x-bg-white margin-bottom22 x_margin0auto w-90 my_order tip">
|
||||
<view class="padding-30">
|
||||
<view class="goods_info d-flex j-sb w-50 a-center">
|
||||
<view class="font_28">{{orderInfo.user_address.consignee}}</view>
|
||||
<view class="">{{orderInfo.user_address.tel}}</view>
|
||||
</view>
|
||||
<view class="goods_info d-flex j-sb a-center">
|
||||
<image src="../../static/my/weizhi.png" mode="" style="height:26upx; width:26upx;"></image>
|
||||
<view class="font_26 w-90">{{orderInfo.user_address.address}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="orderInfo.order_detail.express_status > 0" class="x-bg-white margin-bottom22 x_margin0auto w-90 my_order" @click.stop="dump_express(orderInfo.order_detail.order_id,orderInfo.order_detail.express_sn,orderInfo.order_detail.express_name)">
|
||||
<view class="padding-30">
|
||||
<view class="goods_info d-flex j-sb a-center">
|
||||
<image src="../../static/my/mycar.png" mode="" style="height:26upx; width:26upx;"></image>
|
||||
<view class="flex-1 padding-zy30">
|
||||
<view class="x-text-159">点击可查看物流详情</view>
|
||||
<view>{{orderInfo.order_detail.shipping_time}}</view>
|
||||
</view>
|
||||
<image src="../../static/my/right.png" mode="" style="height:33upx; width:21upx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="x-bg-white margin-bottom22 x_margin0auto w-90 my_order padding-30">
|
||||
<view class="font-weight">订单信息</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>订单编号</view>
|
||||
<view>{{orderInfo.order_detail.order_sn}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>下单时间</view>
|
||||
<view>{{orderInfo.order_detail.create_time}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>支付方式</view>
|
||||
<view>{{orderInfo.order_detail.pay_type_text}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="x-bg-white margin-bottom22 x_margin0auto w-90 my_order padding-30">
|
||||
<view class="d-flex j-sb">
|
||||
<view>开具发票</view>
|
||||
<view>电子发票</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>明细内容-{{orderInfo.buyer_info.invoice_title}}</view>
|
||||
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="d-flex goods_items a-center w-100" v-for="(item,index) of orderInfo.order_goods" :key='index'>
|
||||
<view class="box_img">
|
||||
<an-image :src="item.app_thumb?item.app_thumb:'https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg'" alt="https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg"></an-image>
|
||||
<!-- <image :src="item.app_thumb?item.app_thumb:'../../static/noimg.png'" mode="" class="h-100 w-100"></image> -->
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">{{item.name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>{{item.spec_desc}}</view>
|
||||
<view>{{item.retail_flag == 0 ? '零' : '整'}}</view>
|
||||
<view>X {{item.goods_number}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb margin-shu20">
|
||||
<view class="x-text-159">¥ {{item.total}}</view>
|
||||
<!-- <view class="customer_service text-center" @click="customer_service(index)">申请售后</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="x-bg-white margin-bottom22 x_margin0auto w-90 my_order padding-30">
|
||||
<view class="d-flex j-sb">
|
||||
<view>商品总额</view>
|
||||
<view>¥ {{orderInfo.order_detail.goods_amount}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>运费</view>
|
||||
<view>¥ {{orderInfo.order_detail.shipping_fee}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>订单总价</view>
|
||||
<view>¥ {{orderInfo.order_detail.total_amount}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>实付金额</view>
|
||||
<view>¥ {{orderInfo.order_detail.total_amount}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="x_public_box x-text-white x-bg-159 margin-shu20 shadow addBtn w-90" style="line-height: 80upx;" v-if='orderInfo.order_detail.order_status==1' @click="dump_pay()">去支付</view>
|
||||
<!-- <view v-if="orderInfo.order_detail.order_status==1" class="d-flex bottom-0 right-0 w-100">
|
||||
<view class="flex-1 main-bg-color text-white font-md py-2 text-center btn3"
|
||||
hover-class="main-bg-hover-color" @click="add()">去支付</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import uniCombox from "../../components/uni-combox/uni-combox/uni-combox.vue"
|
||||
import PublicTop from '../../components/HeaderTop/PublicTop.vue'
|
||||
import order from '../../utils/models/order.js'
|
||||
import anImage from '@/components/an-image/an-image'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id:0,
|
||||
orderInfo: {
|
||||
invalid_order_goods: [],
|
||||
buyer_info: {},
|
||||
user_address: {},
|
||||
order_goods: [],
|
||||
order_detail: {},
|
||||
cancel_reason: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
uniCombox,
|
||||
PublicTop,
|
||||
anImage
|
||||
},
|
||||
methods: {
|
||||
//申请售后
|
||||
customer_service(index){
|
||||
|
||||
},
|
||||
// 去支付
|
||||
dump_pay(){
|
||||
// 跳转选择支付页面
|
||||
uni.navigateTo({
|
||||
url:'../my/pay_type?order_id='+this.orderInfo.order_detail.order_id
|
||||
})
|
||||
},
|
||||
// 查看物流
|
||||
dump_express(id,express_sn,express_name){
|
||||
uni.navigateTo({
|
||||
url:'../order/express?id='+id+'&express_sn='+express_sn+'&express_name='+express_name
|
||||
})
|
||||
},
|
||||
async getInfo() {
|
||||
let data = await order.getInfo(this.id)
|
||||
this.orderInfo = data.data
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id
|
||||
this.index = option.index
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place{
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
.content {
|
||||
uni-textarea{
|
||||
width:100%;
|
||||
}
|
||||
height:100%;
|
||||
overflow-y: auto;
|
||||
.banner {
|
||||
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
height: 221upx;
|
||||
|
||||
.is_state {
|
||||
padding: 50upx 0 0 64upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
}
|
||||
.banner1{
|
||||
background-image: url(../../static/my/banner1.png);
|
||||
}
|
||||
.banner2{
|
||||
background-image: url(../../static/my/banner2.png);
|
||||
}
|
||||
.banner3{
|
||||
background-image: url(../../static/my/banner3.png);
|
||||
}
|
||||
.banner4{
|
||||
background-image: url(../../static/my/banner4.png);
|
||||
}
|
||||
.banner5{
|
||||
background-image: url(../../static/my/banner5.png);
|
||||
}
|
||||
.banner6{
|
||||
background-image: url(../../static/my/banner6.png);
|
||||
}
|
||||
.tip{
|
||||
margin-top: -60upx;
|
||||
}
|
||||
.my_order {
|
||||
border-radius: 20upx;
|
||||
position: relative;
|
||||
.refund_form{
|
||||
height: 80upx;
|
||||
.selection-component{
|
||||
border:1upx solid #C3C3C3;
|
||||
overflow: hidden;
|
||||
margin-left:30upx;
|
||||
z-index:88;
|
||||
|
||||
}
|
||||
.selection-show{
|
||||
position: relative;
|
||||
}
|
||||
.selection-list{
|
||||
z-index:99;
|
||||
border:1upx solid #C3C3C3;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
.info{
|
||||
line-height: 30upx;
|
||||
margin-top:20upx;
|
||||
}
|
||||
.select_txt{
|
||||
line-height: 80upx;
|
||||
width:20%;
|
||||
}
|
||||
.select_input{
|
||||
z-index: 106;
|
||||
line-height: 38px;
|
||||
width:75%;
|
||||
}
|
||||
.remarks{
|
||||
padding:20upx 0 0 30upx ;
|
||||
font-size: 26upx;
|
||||
}
|
||||
.updata_img{
|
||||
height:143.6upx;
|
||||
width:150upx;
|
||||
}
|
||||
.is_txt{
|
||||
text-align: justify;
|
||||
}
|
||||
.is_txt:after{
|
||||
content: " ";
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
.customer_service{
|
||||
border:1upx solid #989898;
|
||||
border-radius: 20upx;
|
||||
line-height: 45upx;
|
||||
color: #989898;
|
||||
padding:0 20upx;
|
||||
}
|
||||
}
|
||||
|
||||
.order_list {
|
||||
height: calc(100% - 238upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.order_state {
|
||||
border-radius: 20upx 0 0 20upx;
|
||||
height: 46upx;
|
||||
width: 120upx;
|
||||
background-color: #EDCA4A;
|
||||
line-height: 46upx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.order_items {
|
||||
border-radius: 20upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
}
|
||||
.is_submit{
|
||||
line-height: 82upx;
|
||||
margin:100upx auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
160
金壶/appV1/pages/order/express.vue
Normal file
160
金壶/appV1/pages/order/express.vue
Normal file
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<!-- 查看物流 页面 -->
|
||||
<view class="content bg_F2F2F2">
|
||||
<PublicTop page_title='物流详情'></PublicTop>
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="d-flex goods_items a-center w-100" v-for="(item,index) of goods_list" :key='index'>
|
||||
<view class="box_img">
|
||||
<an-image :src="item.app_thumb?item.app_thumb:'https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg'" alt="https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg"></an-image>
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">{{item.name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>{{item.spec_desc}}</view>
|
||||
<view>{{item.retail_flag == 1?'整':'零'}}</view>
|
||||
<view>X {{item.goods_number}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb margin-shu20">
|
||||
<view class="x-text-159">¥ {{item.unit_price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="wuliu">
|
||||
<uni-steps :options=list direction="column" :active = list_index active-color='#EB5159'></uni-steps>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniSteps from'../../components/uni-steps/uni-steps.vue'
|
||||
import PublicTop from '../../components/HeaderTop/PublicTop.vue'
|
||||
import order from '../../utils/models/order.js'
|
||||
import anImage from '@/components/an-image/an-image'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_info:{},
|
||||
goods_list:[],
|
||||
list: [],
|
||||
list_index:1,
|
||||
order_id:0,
|
||||
exp_num:'',
|
||||
exp_type:'',
|
||||
type:'get_detail'
|
||||
}
|
||||
},
|
||||
components:{
|
||||
PublicTop,
|
||||
uniSteps,
|
||||
anImage
|
||||
},
|
||||
methods: {
|
||||
async getExpress() {
|
||||
let parames = {
|
||||
order_id:this.order_id,
|
||||
exp_num : this.exp_num,
|
||||
exp_type : this.exp_type,
|
||||
type : this.type
|
||||
}
|
||||
let data = await order.getExpress(parames)
|
||||
this.list = data.data.express_info
|
||||
this.goods_list = data.data.order_info.order_goods
|
||||
this.order_info = data.data.order_info.order_detail
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getExpress()
|
||||
},
|
||||
onLoad(option) {
|
||||
this.order_id = option.id
|
||||
this.exp_num = option.express_sn
|
||||
this.exp_type = option.express_name
|
||||
this.type = 'get_detail'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place{
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
.content {
|
||||
height:100%;
|
||||
overflow-y: auto;
|
||||
.my_order {
|
||||
margin-top:30upx;
|
||||
border-radius: 20upx;
|
||||
position: relative;}
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
.order_list {
|
||||
height: calc(100% - 238upx);
|
||||
overflow-y: auto;
|
||||
.order_items {
|
||||
border-radius: 20upx;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
font-size: 26upx;
|
||||
|
||||
.list_items {
|
||||
position: relative;
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
position: relative;
|
||||
|
||||
.goods_count {
|
||||
position: absolute;
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
}
|
||||
.look_logistics{
|
||||
border-radius: 20upx;
|
||||
width:132upx;
|
||||
height:45upx;
|
||||
line-height: 45upx;
|
||||
text-align: center;
|
||||
border:1upx solid #C3C3C3;
|
||||
|
||||
position: absolute;
|
||||
right:22upx;
|
||||
bottom:-54upx;
|
||||
}
|
||||
}
|
||||
.img{
|
||||
height:17upx;
|
||||
width:32upx;
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
347
金壶/appV1/pages/order/index.vue
Normal file
347
金壶/appV1/pages/order/index.vue
Normal file
@@ -0,0 +1,347 @@
|
||||
<template>
|
||||
<!-- 我的订单 页面 -->
|
||||
<view class="bg_F2F2F2 h-100">
|
||||
<PublicTop page_title='我的订单'></PublicTop>
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<view class="menu d-flex j-around x-bg-white shadow">
|
||||
<view class="" v-for="(item,index) of menu" :key='index' :class="{menu_active:menu_index == index}" @click="choose_menu(index)">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="place1"></view>
|
||||
<view v-if='orderList.length<=0' align="center" class="no_list">
|
||||
<image src="../../static/no/u/carno.png" mode="" class="no_list"></image>
|
||||
<view class="x_textCenter margin-shu20 x_text_hui">暂无订单</view>
|
||||
</view>
|
||||
<view class="padding-zy30 bg_F2F2F2">
|
||||
<view class="order_list x_margin0auto" v-if='orderList.length>0'>
|
||||
<view class="padding-30 order_items margin-shu20 x-bg-white" v-for="(item,index) of orderList" :key='index' @click="dump_details(item.order_id,index)">
|
||||
<view class="d-flex j-sb a-center">
|
||||
<view class="" style="width:78%;">订单编号</view>
|
||||
<!-- // 1货到付款,值2线下支付,值3小程序支付,值4微信支付,值5支付宝支付 -->
|
||||
<image src="../../static/shoppingCart/weixin.png" mode="" style="height:32upx; width:32upx;" v-if='item.pay_type==4'></image>
|
||||
<image src="../../static/shoppingCart/zhifubao.png" mode="" style="height:32upx; width:32upx;" v-if='item.pay_type==5'></image>
|
||||
<image src="../../static/shoppingCart/huo.png" mode="" style="height:32upx; width:32upx;" v-if='item.pay_type==1'></image>
|
||||
<image src="../../static/shoppingCart/gong.png" mode="" style="height:32upx; width:32upx;" v-if='item.pay_type==2'></image>
|
||||
<view>{{item.order_status_str}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>{{item.order_sn}}</view>
|
||||
<view class="x_text_hui">{{item.create_time}}</view>
|
||||
</view>
|
||||
<view class="list x-bg-white padding-sx30">
|
||||
<view class="list_items">
|
||||
<view class="items_li d-flex a-center" v-for="(value,key) of item.goods_list" :key="key">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="box_img">
|
||||
<an-image :src="value.app_thumb?value.app_thumb:'https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg'" alt="https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg"></an-image>
|
||||
<!-- <image :src="value.app_thumb?value.app_thumb:'../../static/noimg.png'" mode="" class="h-100 w-100"></image> -->
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">{{value.name}}</view>
|
||||
<view class="x_text_hui">{{value.manufacturer_name}}</view>
|
||||
<view class="">{{value.spec_desc}} {{value.unit}}</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x-text-159">¥ {{value.unit_price}}</view>
|
||||
<view class="">X {{value.goods_number}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex padding-zy30 j-end">
|
||||
<text class="x_text_hui">共{{item.total_num}}件,</text>
|
||||
<text class="x_text_hei2828 margin-zy20 font-weight">合计:</text>
|
||||
<text class="x-text-159">¥ {{item.total_amount}}</text>
|
||||
</view>
|
||||
<view class="place2"></view>
|
||||
<view class="func_btn d-flex j-end">
|
||||
<view v-if="item.order_status == 1" style="background-color: #FF8800; border:none;" class="x-text-white look_logistics margin-zy20" @click.stop="dump_pay(item.order_id)">去支付</view>
|
||||
<view v-if="item.order_status == 1" class="x_text_hui look_logistics margin-zy20" @click.stop="cancel_pay(item)">取消订单</view>
|
||||
<view v-if="item.order_status == 4" class="x_text_hui look_logistics margin-zy20">订单已取消</view>
|
||||
<view v-if="item.order_status >= 5" class="x_text_hui look_logistics margin-zy20" @click.stop="dump_express(item.order_id,item.express_sn,item.express_name)">查看物流</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="loading-text">{{loadingText}}</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//
|
||||
import PublicTop from '../../components/HeaderTop/PublicTop.vue'
|
||||
import order from '../../utils/models/order.js'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import anImage from '@/components/an-image/an-image'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
page:1,
|
||||
isScroll:true,
|
||||
orderList:[
|
||||
|
||||
],
|
||||
loadingText:"",
|
||||
status:'',
|
||||
demoStatus:1,
|
||||
menu_index: 0, // 菜单当前下标
|
||||
// 1 待付款 2代发货 6待收货 3已完成
|
||||
menu: [{
|
||||
name: '全部'
|
||||
}, {
|
||||
name: '待付款'
|
||||
}, {
|
||||
name: '待发货'
|
||||
}, {
|
||||
name: '待收货'
|
||||
}, {
|
||||
name: '已完成'
|
||||
}]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
PublicTop,
|
||||
anImage
|
||||
},
|
||||
onLoad(option) {
|
||||
// 1 待付款 2代发货 6待收货 3已完成
|
||||
if(option.is_index){
|
||||
this.menu_index = option.is_index
|
||||
if(this.menu_index==1){
|
||||
this.status = 1;
|
||||
}
|
||||
if(this.menu_index==2){
|
||||
this.status = 2;
|
||||
}
|
||||
if(this.menu_index==3){
|
||||
this.status = 6;
|
||||
}
|
||||
if(this.menu_index==4){
|
||||
this.status = 3;
|
||||
}
|
||||
}
|
||||
},
|
||||
//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
|
||||
onPullDownRefresh() {
|
||||
setTimeout(()=>{
|
||||
this.reload();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 1000);
|
||||
},
|
||||
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance"
|
||||
onReachBottom(){
|
||||
if(!this.isScroll){
|
||||
this.loadingText="到底了";
|
||||
return false;
|
||||
}else{
|
||||
this.loadingText="正在加载...";
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getList() {
|
||||
let parames = {
|
||||
page:this.page,
|
||||
order_status:this.status
|
||||
}
|
||||
let data = await order.getList(parames)
|
||||
|
||||
if(data.data.current_page == data.data.last_page){
|
||||
this.isScroll = false
|
||||
this.loadingText="到底了";
|
||||
}
|
||||
for (let i = 0; i < data.data.data.length; i++) {
|
||||
this.orderList.push(data.data.data[i])
|
||||
}
|
||||
this.page++
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 查看物流
|
||||
dump_express(id,express_sn,express_name){
|
||||
uni.navigateTo({
|
||||
url:'../order/express?id='+id+'&express_sn='+express_sn+'&express_name='+express_name
|
||||
})
|
||||
},
|
||||
cancel_pay(item){
|
||||
let _this = this
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认是否取消此订单',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
_this.do_cancel_pay(item)
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消订单
|
||||
async do_cancel_pay(item){
|
||||
let res = await X_goods.x_cancelOrder(item.order_id)
|
||||
this.orderList.splice(item,1)
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 去支付
|
||||
dump_pay(id){
|
||||
// 跳转选择支付页面
|
||||
uni.navigateTo({
|
||||
url:'../my/pay_type?order_id='+id
|
||||
})
|
||||
},
|
||||
|
||||
// 查看订单详情页
|
||||
dump_details(id,index){
|
||||
uni.navigateTo({
|
||||
url:'../order/details?id='+id+'&index='+index
|
||||
})
|
||||
},
|
||||
// 选择菜单
|
||||
choose_menu(index) {
|
||||
this.menu_index = index;
|
||||
this.page = 1
|
||||
this.isScroll = true
|
||||
this.orderList = []
|
||||
this.loadingText="正在加载...";
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 300
|
||||
});
|
||||
switch(index){
|
||||
case 0: {
|
||||
this.status = '';
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
this.status = 1;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
this.status = 2;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
this.status = 6;
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
this.status = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.page = 1
|
||||
this.isScroll = true
|
||||
this.orderList = []
|
||||
this.getList()
|
||||
},
|
||||
created(){
|
||||
// this.page = 1
|
||||
// this.isScroll = true
|
||||
// this.orderList = []
|
||||
// this.getList()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place{
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
.place1{
|
||||
background-color: #ffffff;
|
||||
height: 90upx;
|
||||
}
|
||||
.place2{
|
||||
background-color: #ffffff;
|
||||
height: 40upx;
|
||||
}
|
||||
.loading-text{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 60upx;
|
||||
color: #979797;
|
||||
font-size: 24upx;
|
||||
}
|
||||
.menu {
|
||||
z-index: 1;
|
||||
font-size: 30upx;
|
||||
line-height: 90upx;
|
||||
width: 100%;
|
||||
position:fixed;
|
||||
.menu_active {
|
||||
border-bottom: 4upx solid #6E67FF;
|
||||
color: #6E67FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.no_list{
|
||||
height:199upx;
|
||||
width:395upx;
|
||||
}
|
||||
.no_list{
|
||||
text-align:center;
|
||||
margin:23upx auto;
|
||||
}
|
||||
.order_list {
|
||||
height: calc(100% - 238upx);
|
||||
|
||||
overflow-y: auto;
|
||||
.order_items {
|
||||
border-radius: 20upx;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
font-size: 26upx;
|
||||
.list_items {
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
.goods_count {
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
}
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
}
|
||||
.look_logistics{
|
||||
border-radius: 10upx;
|
||||
// width:132upx;
|
||||
height:52upx;
|
||||
line-height: 52upx;
|
||||
width:160upx;
|
||||
|
||||
// line-height: 45upx;
|
||||
text-align: center;
|
||||
border:1upx solid #C3C3C3;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1
金壶/appV1/pages/refund/.pydio
Normal file
1
金壶/appV1/pages/refund/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
51fe35e6-5189-4f00-8956-b23d16c65ec8
|
||||
189
金壶/appV1/pages/refund/refund.vue
Normal file
189
金壶/appV1/pages/refund/refund.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<view class="bg_F2F2F2">
|
||||
<ServiceTop page_title='退款/售后'></ServiceTop>
|
||||
<!-- 占位 -->
|
||||
<view class="place"></view>
|
||||
<!-- 商品列表 -->
|
||||
<view class="goods_list">
|
||||
<view class="order_list">
|
||||
<view class="padding-30 order_items margin-shu20 x-bg-white" v-for="(item,index) of serviceList" :key='index' @click="to_refundDetail(item.id,index)">
|
||||
<view class="d-flex">
|
||||
<view>退款订单详情</view>
|
||||
<view class="margin-zy20">{{item.order_sn}}</view>
|
||||
<view class="order_state text-center x-text-white">{{item.status_text}}</view>
|
||||
</view>
|
||||
<view class="list x-bg-white margin-bottom22 padding-sx30">
|
||||
<view class="list_items">
|
||||
<view class="items_li d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="box_img">
|
||||
<image :src="item.app_thumb" mode="" class="h-100 w-100"></image>
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">{{item.name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="">{{item.spec_desc}} {{item.retail_flag}}</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x-text-159">¥ {{item.unit_price}}</view>
|
||||
<view class="">X {{item.goods_number}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex padding-zy30 j-end">
|
||||
<text class="x_text_hui">退款金额 :</text>
|
||||
<text class="x-text-159">¥ {{item.total_price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="loading-text">{{loadingText}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ServiceTop from '../../components/HeaderTop/ServiceTop.vue'
|
||||
import service from '../../utils/models/service.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
page:1,
|
||||
isScroll:true,
|
||||
serviceList:[],
|
||||
loadingText:"正在加载...",
|
||||
};
|
||||
},
|
||||
components: {
|
||||
ServiceTop
|
||||
},
|
||||
//下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
|
||||
onPullDownRefresh() {
|
||||
setTimeout(()=>{
|
||||
this.reload();
|
||||
uni.stopPullDownRefresh();
|
||||
}, 1000);
|
||||
},
|
||||
//上拉加载,需要自己在page.json文件中配置"onReachBottomDistance"
|
||||
onReachBottom(){
|
||||
if(!this.isScroll){
|
||||
this.loadingText="到底了";
|
||||
return false;
|
||||
}else{
|
||||
this.loadingText="正在加载...";
|
||||
setTimeout(() => {
|
||||
this.getList();
|
||||
}, 500);
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 查看订单详情
|
||||
to_refundDetail(id,index){
|
||||
uni.navigateTo({
|
||||
url:'../refund/refund_details?id='+id+'&index='+index
|
||||
})
|
||||
},
|
||||
async getList() {
|
||||
let parames = {
|
||||
page:this.page
|
||||
}
|
||||
|
||||
let data = await service.getList(parames)
|
||||
if(data.data.current_page == data.data.last_page){
|
||||
this.isScroll = false
|
||||
}
|
||||
for (let i = 0; i < data.data.data.length; i++) {
|
||||
this.serviceList.push(data.data.data[i])
|
||||
}
|
||||
this.page++
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
created(){
|
||||
if(this.page){
|
||||
this.isScroll = true
|
||||
this.serviceList = []
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
onShow:function(e) {
|
||||
let pages = getCurrentPages();
|
||||
let currPage = pages[pages.length-1];
|
||||
if (currPage.index){
|
||||
this.serviceList[currPage.index]['status_text'] = currPage.status_text
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.place{
|
||||
background-color: #ffffff;
|
||||
height: 148upx;
|
||||
}
|
||||
.loading-text{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 60upx;
|
||||
color: #979797;
|
||||
font-size: 24upx;
|
||||
}
|
||||
.order_list {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
.order_state{
|
||||
border-radius: 20upx 0 0 20upx;
|
||||
height:46upx;
|
||||
width:140upx;
|
||||
background-color: #EDCA4A;
|
||||
line-height: 46upx;
|
||||
right:0;
|
||||
}
|
||||
.order_items {
|
||||
border-radius: 20upx;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
font-size: 26upx;
|
||||
|
||||
.list_items {
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
display: flex;
|
||||
.goods_count {
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
}
|
||||
.look_logistics{
|
||||
border-radius: 20upx;
|
||||
width:132upx;
|
||||
height:45upx;
|
||||
line-height: 45upx;
|
||||
text-align: center;
|
||||
border:1upx solid #C3C3C3;
|
||||
right:22upx;
|
||||
bottom:-54upx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
440
金壶/appV1/pages/refund/refund_details.vue
Normal file
440
金壶/appV1/pages/refund/refund_details.vue
Normal file
@@ -0,0 +1,440 @@
|
||||
<template>
|
||||
<!-- 售后进度 页面 -->
|
||||
<view class="content bg_F2F2F2">
|
||||
<HeaderTop page_title='售后进度'></HeaderTop>
|
||||
<!-- 商家正在处理中 -->
|
||||
<view v-if="serviceInfo.status == 1" class="banner x-text-white margin-bottom22 banner3">
|
||||
<view class="font-weight is_state">商家正在处理中</view>
|
||||
<view class="state_txt padding-zy64">您已成功提交售后申请,请耐心等待</view>
|
||||
</view>
|
||||
<!-- 申请已通过 -->
|
||||
<view v-if="serviceInfo.status == 2 || serviceInfo.status == 3" class="banner x-text-white margin-bottom22 banner4">
|
||||
<view class="font-weight is_state">申请已通过</view>
|
||||
<view class="state_txt padding-zy64">申请已通过,请填写信息</view>
|
||||
</view>
|
||||
|
||||
<!-- 申请已拒绝 -->
|
||||
<view v-if="serviceInfo.status == 4" class="banner x-text-white margin-bottom22 banner4">
|
||||
<view class="font-weight is_state">申请已拒绝</view>
|
||||
<view class="state_txt padding-zy64">申请已通过,请填写信息</view>
|
||||
</view>
|
||||
|
||||
<!-- 已提交物流 -->
|
||||
<view v-if="serviceInfo.status == 5" class="banner x-text-white margin-bottom22 banner4">
|
||||
<view class="font-weight is_state">等待客服确认收货</view>
|
||||
<view class="state_txt padding-zy64">您的退货已经在运送途中,请耐心等待</view>
|
||||
</view>
|
||||
|
||||
<!-- 财务待退款 -->
|
||||
<view v-if="serviceInfo.status == 6" class="banner x-text-white margin-bottom22 banner4">
|
||||
<view class="font-weight is_state">等待财务退款</view>
|
||||
<view class="state_txt padding-zy64">您已售后申请已经通过,请耐心等待财务退款</view>
|
||||
</view>
|
||||
|
||||
<!-- 售后完成 -->
|
||||
<view v-if="serviceInfo.status == 7" class="banner x-text-white margin-bottom22 banner4">
|
||||
<view class="font-weight is_state">已完成</view>
|
||||
<view class="state_txt padding-zy64">此售后已经完成</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="d-flex j-sb">
|
||||
<view>退款订单详情</view>
|
||||
<view class="margin-zy20">2020202020202</view>
|
||||
</view>
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="box_img">
|
||||
<image src="../../static/1000.jpg" mode="" class="h-100 w-100"></image>
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">盐酸二甲双胍缓释片</view>
|
||||
<view class="">中国药科大学制药有限公司</view>
|
||||
<view class="">50mg*20s 整</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x-text-159">¥ 4.00</view>
|
||||
<view class="">X 4</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="serviceInfo.status == 2" class="d-flex a-center x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="" style="width:40%">商家处理详情</view>
|
||||
<view class="flex-1">
|
||||
<view>商家同意退货申请,等待您退货</view>
|
||||
<view class="x-text-159 font-20 info">为了不影响商品二次销售,请在2020-0
|
||||
4-25 00:00:00前寄回该商品,逾期未退
|
||||
货,退款申请将超时关闭。
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="serviceInfo.status > 0 && serviceInfo.status < 99" class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="">退货详情</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">申请类型 : </view>
|
||||
<view class="flex-1">{{serviceInfo.type_text}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">原因 : </view>
|
||||
<view class="flex-1">{{serviceInfo.reason_text}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">退款金额 : </view>
|
||||
<view class="flex-1">{{serviceInfo.refund_price}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">退款说明 : </view>
|
||||
<view class="flex-1">{{serviceInfo.refund_content}}</view>
|
||||
</view>
|
||||
<view class="d-flex" v-if="serviceInfo.img">
|
||||
<view class="select_txt" style="width:30%;">上传图片</view>
|
||||
<image src="../../static/1000.jpg" mode="" class="updata_img"></image>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">申请日期 : </view>
|
||||
<view class="flex-1">2020-02-02 15:02:32</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="serviceInfo.status == 3" class="d-flex a-center x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="" style="width:40%">商家处理详情</view>
|
||||
<view class="flex-1">
|
||||
<view>商家同意退款申请,等待客服处理</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="serviceInfo.status == 2" class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="">退货信息</view>
|
||||
<view class="">
|
||||
<view>退货地址 : 安徽省合肥市瑶海区大虾村 售后部</view>
|
||||
<view>联系电话 : 133****3343</view>
|
||||
<view class="d-flex j-sb refund_form">
|
||||
<view class="select_txt"><text class="x-text-159">*</text>物流公司</view>
|
||||
<view class="h-100 select_input">
|
||||
<view class="selection-component">
|
||||
<view class="selection-show padding-zy30 d-flex j-sb a-center" @click="toggleDrop()">
|
||||
<text>{{the_Logistics_company}}</text>
|
||||
<image src="../../static/my/shang.png" mode="" style="height:12upx; width:13upx;" v-if="isLogistics_company==true"></image>
|
||||
<image src="../../static/my/xia.png" mode="" style="height:12upx; width:13upx;" v-if="isLogistics_company==false"></image>
|
||||
</view>
|
||||
<view class="selection-list x-bg-white padding-zy30" v-if="isLogistics_company==true">
|
||||
<view>
|
||||
<view v-for="(item, index) in logistics_company" :key="index" @click="chooseLogistics_company(index)">{{ item.label }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb refund_form margin-shu20">
|
||||
<view class="select_txt"><text class="x-text-159">*</text>物流单号</view>
|
||||
<view class="" style="width:70%;">
|
||||
<input type="number" value="" v-model="express_sn" placeholder="请输入物流单号" class="h-100" style="border:1upx solid #C3C3C3;" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="select_txt">备注</view>
|
||||
<view class="flex-1" style="border:1upx solid #C3C3C3; margin: 0 0 0 30px;">
|
||||
<textarea value="" v-model="express_remarks" placeholder="备注" placeholder-style="color:#989898" class="padding-sx30 remarks" @blur="bindTextAreaBlur" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="serviceInfo.status == 5 && serviceInfo.express_sn" class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="">快递详情</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">物流公司 : </view>
|
||||
<view class="flex-1">{{serviceInfo.express}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">物流单号 : </view>
|
||||
<view class="flex-1">{{serviceInfo.express_sn}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">备注 : </view>
|
||||
<view class="flex-1">{{serviceInfo.express_remarks}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%;">申请日期 : </view>
|
||||
<view class="flex-1">{{serviceInfo.create_time}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex bottom-0 right-0 w-100">
|
||||
<view v-if="serviceInfo.status == 2" class="flex-1 main-bg-color text-white font-md py-2 text-center btn3"
|
||||
hover-class="main-bg-hover-color" @click="submitExpress()">提交物流</view>
|
||||
<view v-if="serviceInfo.status < 7" class="flex-1 main-bg-color bg-danger text-white font-md py-2 text-center btn3"
|
||||
hover-class="main-bg-hover-color" @click="cancel()">撤销申请</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import uniCombox from "../../components/uni-combox/uni-combox/uni-combox.vue"
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import service from '../../utils/models/service.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id:'',
|
||||
index:'',
|
||||
express:0,
|
||||
express_sn:'',
|
||||
express_remarks:'',
|
||||
// 物流公司
|
||||
the_Logistics_company:'请选择', //当前的物流公司名称
|
||||
isLogistics_company: false,
|
||||
logistics_company_index: 0,
|
||||
logistics_company:[{
|
||||
value: '1',
|
||||
label: '物流公司1'
|
||||
},{
|
||||
value: '2',
|
||||
label: '物流公司2'
|
||||
},{
|
||||
value: '3',
|
||||
label: '物流公司3'
|
||||
},{
|
||||
value: '4',
|
||||
label: '物流公司4'
|
||||
}],
|
||||
serviceInfo:{
|
||||
status:0
|
||||
}
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
components: {uniCombox},
|
||||
methods: {
|
||||
// 物流公司
|
||||
chooseLogistics_company (index) {
|
||||
this.logistics_company_index = index
|
||||
this.isLogistics_company = false
|
||||
this.the_Logistics_company = this.logistics_company[index].label
|
||||
this.express = this.logistics_company[index].label
|
||||
},
|
||||
// toggle 物流公司
|
||||
toggleDrop () {
|
||||
this.isLogistics_company = !this.isLogistics_company
|
||||
},
|
||||
bindTextAreaBlur: function (e) {
|
||||
|
||||
|
||||
},
|
||||
async getInfo() {
|
||||
let data = await service.getInfo(this.id)
|
||||
this.serviceInfo = data.data
|
||||
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
submitExpress() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定操作',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
|
||||
that.doSubmitExpress()
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doSubmitExpress() {
|
||||
let parames = {
|
||||
id:this.id,
|
||||
express:this.express,
|
||||
express_sn:this.express_sn,
|
||||
express_sn:this.express_remarks
|
||||
}
|
||||
|
||||
let data = await service.express(parames)
|
||||
if(data.code == 200){
|
||||
uni.redirectTo({
|
||||
url:'../refund/refund_details?id='+data.data.service_id
|
||||
})
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定操作',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
|
||||
that.doCancel()
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doCancel() {
|
||||
let parames = {
|
||||
id:this.id
|
||||
}
|
||||
|
||||
let data = await service.cancel(parames)
|
||||
if(data.code == 200){
|
||||
let pages = getCurrentPages(); //获取所有页面栈实例列表
|
||||
let prevPage = pages[ pages.length - 2 ]; //上一页页面实例
|
||||
prevPage.$vm.index = this.index; //修改上一页data里面的couponNumber参数值为value
|
||||
prevPage.$vm.status_text = data.data.status_text;
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
this.id = option.id
|
||||
this.index = option.index
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
uni-textarea{
|
||||
width:100%;
|
||||
}
|
||||
height:100%;
|
||||
overflow-y: auto;
|
||||
.banner {
|
||||
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
height: 221upx;
|
||||
|
||||
.is_state {
|
||||
padding: 50upx 0 0 64upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
}
|
||||
.banner1{
|
||||
background-image: url(../../static/my/banner1.png);
|
||||
}
|
||||
.banner2{
|
||||
background-image: url(../../static/my/banner2.png);
|
||||
}
|
||||
.banner3{
|
||||
background-image: url(../../static/my/banner3.png);
|
||||
}
|
||||
.banner4{
|
||||
background-image: url(../../static/my/banner4.png);
|
||||
}
|
||||
.banner5{
|
||||
background-image: url(../../static/my/banner5.png);
|
||||
}
|
||||
.banner6{
|
||||
background-image: url(../../static/my/banner6.png);
|
||||
}
|
||||
|
||||
.my_order {
|
||||
border-radius: 20upx;
|
||||
position: relative;
|
||||
.refund_form{
|
||||
height: 80upx;
|
||||
.selection-component{
|
||||
border:1upx solid #C3C3C3;
|
||||
overflow: hidden;
|
||||
margin-left:30upx;
|
||||
z-index:88;
|
||||
|
||||
}
|
||||
.selection-show{
|
||||
position: relative;
|
||||
}
|
||||
.selection-list{
|
||||
z-index:99;
|
||||
border:1upx solid #C3C3C3;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
.info{
|
||||
line-height: 30upx;
|
||||
margin-top:20upx;
|
||||
}
|
||||
.select_txt{
|
||||
line-height: 80upx;
|
||||
width:20%;
|
||||
}
|
||||
.select_input{
|
||||
z-index: 106;
|
||||
line-height: 38px;
|
||||
width:75%;
|
||||
}
|
||||
.remarks{
|
||||
// padding:20upx 0 0 30upx ;
|
||||
font-size: 26upx;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.updata_img{
|
||||
height:143.6upx;
|
||||
width:150upx;
|
||||
}
|
||||
.is_txt{
|
||||
text-align: justify;
|
||||
}
|
||||
.is_txt:after{
|
||||
content: " ";
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.order_list {
|
||||
height: calc(100% - 238upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.order_state {
|
||||
border-radius: 20upx 0 0 20upx;
|
||||
height: 46upx;
|
||||
width: 120upx;
|
||||
background-color: #EDCA4A;
|
||||
line-height: 46upx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.order_items {
|
||||
border-radius: 20upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
}
|
||||
.is_submit{
|
||||
line-height: 82upx;
|
||||
margin:100upx auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
349
金壶/appV1/pages/refund/refund_submit.vue
Normal file
349
金壶/appV1/pages/refund/refund_submit.vue
Normal file
@@ -0,0 +1,349 @@
|
||||
<template>
|
||||
<!-- 售后进度 页面 -->
|
||||
<view class="content bg_F2F2F2">
|
||||
<HeaderTop page_title='售后进度'></HeaderTop>
|
||||
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="d-flex j-sb">
|
||||
<view>退款订单详情</view>
|
||||
<view class="margin-zy20">2020202020202</view>
|
||||
</view>
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="box_img">
|
||||
<image src="../../static/1000.jpg" mode="" class="h-100 w-100"></image>
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">盐酸二甲双胍缓释片</view>
|
||||
<view class="">中国药科大学制药有限公司</view>
|
||||
<view class="">50mg*20s 整</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x-text-159">¥ 4.00</view>
|
||||
<view class="">X 4</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="">退货信息</view>
|
||||
<view class="">
|
||||
<view class="d-flex j-sb refund_form">
|
||||
<view class="select_txt"><text class="x-text-159">*</text>申请类型</view>
|
||||
<view class="h-100 select_input">
|
||||
<view class="selection-component">
|
||||
<view class="selection-show padding-zy30 d-flex j-sb a-center" @click="toggle_Apply_types()">
|
||||
<text>{{the_Apply_types}}</text>
|
||||
<image src="../../static/my/shang.png" mode="" style="height:12upx; width:13upx;" v-if="isApply_types==true"></image>
|
||||
<image src="../../static/my/xia.png" mode="" style="height:12upx; width:13upx;" v-if="isApply_types==false"></image>
|
||||
</view>
|
||||
<view class="selection-list x-bg-white padding-zy30" v-if="isApply_types==true">
|
||||
<view>
|
||||
<view v-for="(item, index) in apply_types" :key="index" @click="chooseapply_types(index)">{{ item.label}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb refund_form margin-shu20">
|
||||
<view class="select_txt"><text class="x-text-159">*</text>退款金额</view>
|
||||
<view class="" style="width:70%;">
|
||||
<input type="number" value="" v-model="refund_price" placeholder="请输入退款金额" class="h-100" style="border:1upx solid #C3C3C3;" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="flex-1" style="border:1upx solid #C3C3C3; margin: 0 0 0 30px;">
|
||||
<textarea value="" v-model="refund_content" placeholder="请具体描述" placeholder-style="color:#989898" class="padding-sx30 remarks" @blur="bindTextAreaBlur" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb refund_form margin-shu20">
|
||||
<view class="select_txt"><text class="x-text-159">*</text>原因</view>
|
||||
<view class="h-100 select_input">
|
||||
<view class="selection-component">
|
||||
<view class="selection-show padding-zy30 d-flex j-sb a-center" @click="toggle_refund_reason()">
|
||||
<text>{{the_refund_reason}}</text>
|
||||
<image src="../../static/my/shang.png" mode="" style="height:12upx; width:13upx;" v-if="isRefund_reason==true"></image>
|
||||
<image src="../../static/my/xia.png" mode="" style="height:12upx; width:13upx;" v-if="isRefund_reason==false"></image>
|
||||
</view>
|
||||
<view class="selection-list x-bg-white padding-zy30" v-if="isRefund_reason==true">
|
||||
<view>
|
||||
<view v-for="(item, index) in refund_reason" :key='index' @click="chooseRefund_reason(index)">{{ item.label }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="x_margin0auto w-90 padding-30 x-bg-white my_order margin-bottom22">
|
||||
<view class="upData">
|
||||
上传图片(最多可上传3张)
|
||||
</view>
|
||||
<view class="upData_box">
|
||||
<input type="file" id='upload_file' accept='image/*' name='file' @change='fileChange($event)'>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="d-flex bottom-0 right-0 w-100">
|
||||
<view class="flex-1 main-bg-color text-white font-md py-2 text-center btn3"
|
||||
hover-class="main-bg-hover-color" @click="add()">提交退货信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import uniCombox from "../../components/uni-combox/uni-combox/uni-combox.vue"
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import service from '../../utils/models/service.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id:'',
|
||||
refund_price:"",
|
||||
refund_content:"",
|
||||
reason:0,
|
||||
type:0,
|
||||
//申请类型
|
||||
the_Apply_types:'请选择', //当前的物流公司名称
|
||||
isApply_types: false,
|
||||
apply_types_index:0,
|
||||
apply_types: [{
|
||||
value: '1',
|
||||
label: '申请类型1'
|
||||
}, {
|
||||
value: '2',
|
||||
label: '申请类型2'
|
||||
}, {
|
||||
value: '3',
|
||||
label: '申请类型3'
|
||||
}],
|
||||
// 退款原因
|
||||
the_refund_reason:'请选择', //当前的物流公司名称
|
||||
isRefund_reason: false,
|
||||
refund_reason_index:0,
|
||||
refund_reason:[{
|
||||
value: '1',
|
||||
label: '退款原因1'
|
||||
}, {
|
||||
value: '2',
|
||||
label: '退款原因2'
|
||||
}, {
|
||||
value: '3',
|
||||
label: '退款原因3'
|
||||
}],
|
||||
serviceInfo:{},
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
components: {uniCombox},
|
||||
methods: {
|
||||
//退款原因
|
||||
chooseRefund_reason(index){
|
||||
this.refund_reason_index = index
|
||||
this.isRefund_reason = false
|
||||
this.the_refund_reason = this.refund_reason[index].label
|
||||
this.reason = this.refund_reason[index].value
|
||||
},
|
||||
//toggle 退款原因
|
||||
toggle_refund_reason(){
|
||||
this.isRefund_reason = !this.isRefund_reason
|
||||
},
|
||||
// 申请类型
|
||||
chooseapply_types(index){
|
||||
this.apply_types_index = index
|
||||
this.isApply_types = false
|
||||
this.the_Apply_types = this.apply_types[index].label
|
||||
this.type = this.apply_types[index].value
|
||||
},
|
||||
// toggle 申请类型
|
||||
toggle_Apply_types(){
|
||||
this.isApply_types = !this.isApply_types
|
||||
},
|
||||
bindTextAreaBlur: function (e) {
|
||||
|
||||
|
||||
},
|
||||
async getInfo() {
|
||||
let data = await service.getInfo(this.id)
|
||||
this.serviceInfo = data.data
|
||||
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
add() {
|
||||
let that = this;
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定操作',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
|
||||
that.doAdd()
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
async doAdd() {
|
||||
let parames = {
|
||||
order_id:1,
|
||||
order_goods_id:1,
|
||||
type:this.type,
|
||||
reason:this.reason,
|
||||
refund_price:this.refund_price,
|
||||
refund_content:this.refund_content
|
||||
}
|
||||
|
||||
let data = await service.add(parames)
|
||||
if(data.code == 200){
|
||||
uni.redirectTo({
|
||||
url:'../refund/refund_details?id='+data.data.service_id
|
||||
})
|
||||
}
|
||||
this.handleError(data, res => {
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
this.id = option.id
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
uni-textarea{
|
||||
width:100%;
|
||||
}
|
||||
height:100%;
|
||||
overflow-y: auto;
|
||||
.banner {
|
||||
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
height: 221upx;
|
||||
|
||||
.is_state {
|
||||
padding: 50upx 0 0 64upx;
|
||||
line-height: 60upx;
|
||||
}
|
||||
|
||||
}
|
||||
.banner1{
|
||||
background-image: url(../../static/my/banner1.png);
|
||||
}
|
||||
.banner2{
|
||||
background-image: url(../../static/my/banner2.png);
|
||||
}
|
||||
.banner3{
|
||||
background-image: url(../../static/my/banner3.png);
|
||||
}
|
||||
.banner4{
|
||||
background-image: url(../../static/my/banner4.png);
|
||||
}
|
||||
.banner5{
|
||||
background-image: url(../../static/my/banner5.png);
|
||||
}
|
||||
.banner6{
|
||||
background-image: url(../../static/my/banner6.png);
|
||||
}
|
||||
|
||||
.my_order {
|
||||
border-radius: 20upx;
|
||||
position: relative;
|
||||
.refund_form{
|
||||
height: 80upx;
|
||||
.selection-component{
|
||||
border:1upx solid #C3C3C3;
|
||||
overflow: hidden;
|
||||
margin-left:30upx;
|
||||
z-index:88;
|
||||
|
||||
}
|
||||
.selection-show{
|
||||
position: relative;
|
||||
}
|
||||
.selection-list{
|
||||
z-index:99;
|
||||
border:1upx solid #C3C3C3;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 198upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
.info{
|
||||
line-height: 30upx;
|
||||
margin-top:20upx;
|
||||
}
|
||||
.select_txt{
|
||||
line-height: 80upx;
|
||||
width:20%;
|
||||
}
|
||||
.select_input{
|
||||
z-index: 106;
|
||||
line-height: 38px;
|
||||
width:75%;
|
||||
}
|
||||
.remarks{
|
||||
// padding:20upx 0 0 30upx ;
|
||||
font-size: 26upx;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.updata_img{
|
||||
height:143.6upx;
|
||||
width:150upx;
|
||||
}
|
||||
.is_txt{
|
||||
text-align: justify;
|
||||
}
|
||||
.is_txt:after{
|
||||
content: " ";
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.order_list {
|
||||
height: calc(100% - 238upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.order_state {
|
||||
border-radius: 20upx 0 0 20upx;
|
||||
height: 46upx;
|
||||
width: 120upx;
|
||||
background-color: #EDCA4A;
|
||||
line-height: 46upx;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.order_items {
|
||||
border-radius: 20upx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
}
|
||||
.is_submit{
|
||||
line-height: 82upx;
|
||||
margin:100upx auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
1
金壶/appV1/pages/shoppingCart/.pydio
Normal file
1
金壶/appV1/pages/shoppingCart/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
fef9a6cd-ae64-4efa-b0e3-640d68686f59
|
||||
667
金壶/appV1/pages/shoppingCart/goodsDetail.vue
Normal file
667
金壶/appV1/pages/shoppingCart/goodsDetail.vue
Normal file
@@ -0,0 +1,667 @@
|
||||
<template>
|
||||
<!-- 商品详情页 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title=''></HeaderTop>
|
||||
<view class="detail bg_F2F2F2">
|
||||
<view class="x-bg-white margin-bottom22">
|
||||
<view class="banner" :style="{backgroundImage: 'url(' + img_url + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
|
||||
</view>
|
||||
<!-- <view class="banner">
|
||||
<image :src="img_url" mode="" class="banner_img" @error="imgError"></image>
|
||||
</view> -->
|
||||
<view class="padding-30">
|
||||
<view class="collection d-flex j-sb">
|
||||
<view class="font-weight font_28 d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;margin-right: 30upx;" v-if='list.is_limit==1'></image>
|
||||
<image src="../../static/shoppingCart/re.png" mode="" style="height:30upx; width:30upx;margin-right:30upx;" v-if='list.supplier_id<=10000'></image>
|
||||
<view>{{list.goods_name}}</view>
|
||||
</view>
|
||||
<!-- list.is_collect==1已收藏 list.is_collect==0已收藏 -->
|
||||
<image src="../../static/shoppingCart/coll1.png" alt="" class='collection_img' v-if='list.is_collect==1' @click='to_change(2)'></image>
|
||||
<image src="../../static/shoppingCart/coll2.png" alt="" class='collection_img' v-if='list.is_collect==0' @click='to_change(1)'></image>
|
||||
<!-- <img src="../../static/shoppingCart/coll1.png" alt="" class='collection_img' v-if='list.is_collect==1' @click='to_change(2)'>
|
||||
<img src="../../static/shoppingCart/coll2.png" alt="" class='collection_img' v-if='list.is_collect==0' @click='to_change(1)'> -->
|
||||
</view>
|
||||
<view class="textOVerFlow" style="width:100%;">{{list.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
{{list.spec_desc}}
|
||||
<image src="../../static/shoppingCart/zheng.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;" v-if='list.retail_flag == 1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;" v-if='list.retail_flag == 0'></image>
|
||||
<view class="d-flex a-center">{{list.retail_flag==0?list.retail_num:list.entirety_num}}{{list.unit}}/件</view>
|
||||
</view>
|
||||
<view class="goods_info d-flex j-sb">
|
||||
|
||||
<view class="x-text-159 font-weight font_28">¥{{list.price}}</view>
|
||||
<!-- <view class="x_text_hui">库存{{list.stock_num}}盒</view> -->
|
||||
</view>
|
||||
<view class="goods_txt">
|
||||
<!-- <text class="x-text-white bg-EDCA4A time">有效期:{{list.term_validity}}年</text> -->
|
||||
<!-- <text class="txt_info">
|
||||
{{list.sketch}}<text class="x-text-159">说明书 ></text>
|
||||
</text> -->
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<!-- <view class="w-50">销售类型:{{list.retail_flag==0?'零售':'整售'}}({{list.retail_flag==0?list.retail_num:list.entirety_num}})</view> -->
|
||||
<!-- <view class="w-50">
|
||||
建议零售价:<text class="x-text-159">¥{{list.show_price}}</text>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white margin-bottom22 padding-30">
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%">商品名称</view>
|
||||
<view>{{list.goods_name}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%">生产厂家</view>
|
||||
<view>{{list.manufacturer_name}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%">规格</view>
|
||||
<view>{{list.spec_desc}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%">有效期</view>
|
||||
<view>{{list.term_validity}}</view>
|
||||
</view>
|
||||
<view class="d-flex">
|
||||
<view class="" style="width:30%">批准文号</view>
|
||||
<view>{{list.country_code}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white margin-bottom22 padding-30">
|
||||
<view class="font-weight">注意事项</view>
|
||||
<view class="">
|
||||
<view class="x_text_hui zhuyi_title">
|
||||
1.根据国家规定,药品类商品一般情况下无质量问题不支持退货;
|
||||
</view>
|
||||
<view class="x_text_hui zhuyi_title">
|
||||
2.客户在收取商品时,应当面确认商品有无破损,若发生破损,应及时联系客服;确认收货后,概不支持退换货。
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom_menu shadow d-flex a-center">
|
||||
<view class="the_car" @click="to_shoppingCar()">
|
||||
<image src="../../static/tabbar/car2.png" mode="" class="car_img"></image>
|
||||
<view class="car_GoodsNum" v-if='$utils.getLocalStorage("GoodNums")>0'>{{$utils.getLocalStorage("GoodNums")}}</view>
|
||||
</view>
|
||||
<view class="add_shopping_car sameBtn x-text-white text-center" @click="addCar()">加入购物车</view>
|
||||
<view class="buy sameBtn x-text-white text-center" @click="lijiBuy()">立即购买</view>
|
||||
</view>
|
||||
<!-- 购物车遮挡层 -->
|
||||
<view class="car_pop h-100 w-100" v-if="is_pop_show==true" @tap='cancel_popCar()'>
|
||||
<view class="pop_box bg-white w-100" @tap.stop='stop_click()'>
|
||||
<view class="pop_goods_info d-flex a-center padding-zy64">
|
||||
<image src="../../static/shoppingCart/cancel.png" mode="" @click="cancel_popCar()" class="cancel_pop"></image>
|
||||
<view class="pop_box_img d-flex a-center j-center w-100">
|
||||
<image v-if='list' :src="'https://'+list.pc_thumb" mode="" class="pop_img" style="width:30%"></image>
|
||||
<view class="flex-1 h-100" style="width:50%;">
|
||||
<view class="d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" style="height:30upx; width:30upx;margin-right: 30upx;" v-if='list.is_limit==1'></image>
|
||||
<view class="font_28 some_txt font-weight textOVerFlow" style="width:65%;">{{list.goods_name}}</view>
|
||||
</view>
|
||||
<view class="x-text-159" v-if='list.is_limit==1'>{{list.limit_info}}</view>
|
||||
<view class="textOVerFlow" style="width:100%;">{{list.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
{{list.spec_desc}}
|
||||
<image src="../../static/shoppingCart/zheng.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;" v-if='list.retail_flag == 1'></image>
|
||||
<image src="../../static/shoppingCart/ling.png" class="margin-zy20" mode="" style="height:30upx; width:30upx;" v-if='list.retail_flag == 0'></image>
|
||||
|
||||
</view>
|
||||
<view class="d-flex a-center j-sb">
|
||||
<view>{{list.retail_flag==0?list.retail_num:list.entirety_num}}{{list.unit}}/件</view>
|
||||
<view class="x-text-159 font-weight font_28">¥ {{list.price}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="address">
|
||||
<view>选择购买数量</view>
|
||||
<view class="d-flex j-sb a-center">
|
||||
<view class="x-text-159 x-text-font24">小提示:该物品购买数量必须为包装的倍数</view>
|
||||
<view class="goods_count d-flex">
|
||||
<view class="bianji_cars_num bianji_cars_numJian" @click="reduse_goodsNum()">-</view>
|
||||
<input type="number" value="" class="bianji_cars_num bianji_cars_numAdd" v-model="goods_num" @blur="outComputeNum(goods_num)"
|
||||
@focus="inComputeNum()" />
|
||||
<!-- <view class="bianji_cars_num bianji_cars_numAdd">{{goods_num}}</view> -->
|
||||
<view class="bianji_cars_num bianji_cars_numAdd" @click="add_goodsNum()">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="x-bg-159 x_public_box pop_sure x-text-white w-90" @click="sure_btn1()">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapGetters } from 'vuex'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import auth from '../../utils/models/auth.js'
|
||||
import {
|
||||
Config
|
||||
} from '../../utils/config.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
the_index:'', //从首页带进来的下标
|
||||
goods_num: 0, // 商品的当前数量
|
||||
goods_num_copy: 0, // 商品的当前数量copy
|
||||
Stock: 100, //当前商品的总库存
|
||||
sales_type: 10, //销售类型
|
||||
is_collection: 2, //判断是否收藏商品 是:1 ; 否:2
|
||||
is_pop_show: false, // 判断购物车遮挡层的状态 显示:true ; 隐藏:false
|
||||
Which_one: '', //判断用户点击了哪一个按钮 1:加入购物车; 2:立即购买
|
||||
car_GoodsNum: 0, //购物车的商品数量
|
||||
list: '',
|
||||
uc_id: '',
|
||||
sku_id: '', // 传过来的参数
|
||||
is_buy: '',
|
||||
the_Authentication: '', // 判断是否登录
|
||||
is_next: true,
|
||||
img_url: '',
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
onShow() {
|
||||
this.goodsDetail();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'GetShopCarNums'
|
||||
])
|
||||
},
|
||||
onLoad(option) {
|
||||
this.sku_id = option.sku_id
|
||||
if (option.the_index) {
|
||||
this.the_index = option.the_index
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 监听data里面 Which_one值的变化
|
||||
this.$watch("Which_one", function(newValue, oldValue) {
|
||||
if (this.Which_one == 1) {
|
||||
this.goods_num = 0
|
||||
}
|
||||
if (this.Which_one == 2) {
|
||||
this.goods_num = this.goods_num_copy
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations([
|
||||
'SetShopCarNums',
|
||||
]),
|
||||
imgError() {
|
||||
this.img_url = 'https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg';
|
||||
},
|
||||
inComputeNum() {
|
||||
this.is_next = false
|
||||
},
|
||||
outComputeNum(goods_num) {
|
||||
if (this.list.retail_flag == 0) { //零售
|
||||
let num = Math.ceil(goods_num / this.list.retail_num)
|
||||
if (num > 0) {
|
||||
this.goods_num = num * this.list.retail_num
|
||||
if (this.list.stock_num < this.goods_num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.goods_num = this.list.stock_num;
|
||||
}
|
||||
}
|
||||
} else { // 整售
|
||||
let num = Math.ceil(goods_num / this.list.entirety_num)
|
||||
if (num > 0) {
|
||||
this.goods_num = num * this.list.entirety_num
|
||||
if (this.list.stock_num < this.goods_num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.goods_num = this.list.stock_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.is_next = true
|
||||
},
|
||||
// 阻止时间冒泡 不要删除
|
||||
stop_click() {
|
||||
|
||||
},
|
||||
// 去购物车页面
|
||||
to_shoppingCar() {
|
||||
uni.switchTab({
|
||||
url: 'shoppingCart?goods_num=' + this.goods_num
|
||||
})
|
||||
},
|
||||
// 商品详情
|
||||
async goodsDetail() {
|
||||
this.list = []
|
||||
uni.getStorage({
|
||||
key: 'isAuthentication',
|
||||
success: function(res) {
|
||||
this.the_Authentication = res.data
|
||||
|
||||
},
|
||||
});
|
||||
let res = await X_goods.x_goodsDetail(this.sku_id)
|
||||
this.handleError(res, res => {
|
||||
this.list = res.data.data;
|
||||
this.img_url = 'https://' + this.list.pc_thumb
|
||||
this.goods_num = this.list.num_in_cart
|
||||
this.goods_num_copy = this.list.num_in_cart
|
||||
})
|
||||
},
|
||||
//减 商品的数量
|
||||
reduse_goodsNum() {
|
||||
if (this.list.retail_flag == 0) { //零售
|
||||
this.goods_num = this.goods_num - this.list.retail_num
|
||||
} else { // 整售
|
||||
this.goods_num = this.goods_num - this.list.entirety_num
|
||||
}
|
||||
|
||||
if (this.goods_num <= 0) {
|
||||
this.goods_num = 0
|
||||
uni.showToast({
|
||||
title: '商品数量不得为负',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
// 增加 商品的数量
|
||||
async add_goodsNum() {
|
||||
if (this.goods_num == this.list.stock_num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
if (this.list.retail_flag == 0) { //零售
|
||||
this.goods_num = Number(this.goods_num) + Number(this.list.retail_num)
|
||||
} else { // 整售
|
||||
this.goods_num = Number(this.goods_num) + Number(this.list.entirety_num)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 关闭按钮
|
||||
cancel_popCar() {
|
||||
this.is_pop_show = false;
|
||||
|
||||
},
|
||||
//加入购物车
|
||||
addCar() {
|
||||
this.Which_one = 1;
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
},
|
||||
// 立即购买
|
||||
lijiBuy() {
|
||||
this.is_buy = 'buy'
|
||||
this.Which_one = 2;
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
},
|
||||
//checkAuth 检测用户是否完成认证
|
||||
async is_checkAuth() {
|
||||
let res = await auth.checkAuth()
|
||||
this.the_checkAuth = res.data
|
||||
if (res.data != 'finish') {
|
||||
if (res.data == 'auditing') {
|
||||
uni.showToast({
|
||||
title: '您的企业认证正在审核中!',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先完成认证',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '../auth/baisc'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (this.Which_one == 2) {
|
||||
uni.navigateTo({
|
||||
url: './sureOrder?goods_id=' + this.uc_id
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
async liji_buy() {
|
||||
if (!this.is_next) {
|
||||
return
|
||||
}
|
||||
this.is_buy = 'buy'
|
||||
let res = await X_goods.X_addCar(this.list.price_id, this.list.batch_id, this.goods_num, this.is_buy)
|
||||
this.handleError(res, res => {
|
||||
this.uc_id = res.data.uc_id;
|
||||
this.is_checkAuth()
|
||||
})
|
||||
},
|
||||
async addTheCar() {
|
||||
if(!this.is_next){
|
||||
return
|
||||
}
|
||||
// this.is_buy = ''
|
||||
|
||||
let res = await X_goods.X_addCar(this.list.price_id, this.list.batch_id, this.goods_num, this.is_buy)
|
||||
if (res.code == 200 && res.data.errcode == 200 && this.is_buy != 'buy') {
|
||||
uni.showToast({
|
||||
title: '添加成功',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
if (res.data.errcode == -1) {
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
return
|
||||
}
|
||||
|
||||
// 添加商品 计数
|
||||
this.SetShopCarNums();
|
||||
|
||||
this.uc_id = res.data.uc_id;
|
||||
this.is_pop_show = !this.is_pop_show
|
||||
if (this.Which_one == 2) {
|
||||
this.$store.commit('goodid',this.uc_id)
|
||||
this.is_checkAuth()
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
// 弹框点击事件
|
||||
sure_btn1() {
|
||||
if (this.goods_num <= 0) {
|
||||
uni.showToast({
|
||||
title: '请添加商品数量',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
if (this.Which_one == 1) {
|
||||
this.is_buy = ''
|
||||
} else if (this.Which_one == 2) {
|
||||
this.is_buy = 'buy'
|
||||
}
|
||||
if (this.list.retail_flag == 0) { //零售
|
||||
|
||||
if (this.goods_num % this.list.retail_num !== 0) {
|
||||
uni.showToast({
|
||||
title: '该物品购买数量必须为包装的倍数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.addTheCar()
|
||||
}
|
||||
} else {
|
||||
if (this.goods_num % this.list.entirety_num !== 0) {
|
||||
uni.showToast({
|
||||
title: '该物品购买数量必须为包装的倍数',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
this.addTheCar()
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// 改变收藏状态
|
||||
async to_change(num) {
|
||||
const value = uni.getStorageSync('isAuthentication');
|
||||
if (value) {
|
||||
let res = await X_goods.X_addCollect_app(this.list.goods_id, num)
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
if (this.list.is_collect == 1) {
|
||||
this.list.is_collect = 0
|
||||
} else {
|
||||
this.list.is_collect = 1
|
||||
}
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
if (res.data.errmsg) {
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 是否收藏
|
||||
if_collection() {
|
||||
if (this.list.is_collect == 1) {
|
||||
this.list.is_collect = 0
|
||||
} else {
|
||||
this.list.is_collect = 1
|
||||
}
|
||||
},
|
||||
// 改变收藏状态
|
||||
async change_collection() {
|
||||
this.to_change();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.detail {
|
||||
height: calc(100% - 229.5upx);
|
||||
overflow-y: auto;
|
||||
|
||||
.banner {
|
||||
height: 350upx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-repeat: no-repeat;
|
||||
// background-position: center;
|
||||
// background-size: cover;
|
||||
.banner_img {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
// height: 217upx;
|
||||
// max-height: 250upx;
|
||||
// width: 305upx;
|
||||
// max-width: 315upx;
|
||||
}
|
||||
}
|
||||
|
||||
.collection {
|
||||
.collection_img {
|
||||
height: 36upx;
|
||||
width: 36upx;
|
||||
margin-right:30upx;
|
||||
}
|
||||
}
|
||||
|
||||
.goods_txt {
|
||||
.txt_info {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
padding: 0 15upx;
|
||||
border-radius: 10upx;
|
||||
margin: 0 15upx;
|
||||
}
|
||||
|
||||
.zhuyi_title {
|
||||
margin: 20upx 0 20upx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom_menu {
|
||||
height: 81.5upx;
|
||||
overflow: hidden;
|
||||
|
||||
.car_img {
|
||||
height: 41upx;
|
||||
width: 46upx;
|
||||
}
|
||||
|
||||
.car_txt {
|
||||
font-size: 20upx;
|
||||
color: #989898;
|
||||
line-height: 22upx;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.car_GoodsNum {
|
||||
background-color: #EB5159;
|
||||
color: #FFFFFF;
|
||||
position: absolute;
|
||||
top: -16upx;
|
||||
left: 108upx;
|
||||
height: 40upx;
|
||||
width: 40upx;
|
||||
line-height: 40upx;
|
||||
font-size: 20upx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.sameBtn {
|
||||
line-height: 81.5upx;
|
||||
width: 38%;
|
||||
}
|
||||
|
||||
.the_car {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.add_shopping_car {
|
||||
background-color: #EDCA4A;
|
||||
}
|
||||
|
||||
.buy {
|
||||
background-color: #EB5159;
|
||||
}
|
||||
}
|
||||
|
||||
.car_pop {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
top: 0%;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
|
||||
.pop_box {
|
||||
position: absolute;
|
||||
left: 0%;
|
||||
bottom: 0%;
|
||||
// height:707upx;
|
||||
border-radius: 10upx 10upx 0 0;
|
||||
|
||||
.cancel_pop {
|
||||
height: 38upx;
|
||||
width: 38upx;
|
||||
position: absolute;
|
||||
right: 30upx;
|
||||
top: 30upx;
|
||||
}
|
||||
|
||||
.pop_goods_info {
|
||||
height: 267upx;
|
||||
border-bottom: 5upx dashed #989898;
|
||||
|
||||
.pop_box_img {
|
||||
.pop_img {
|
||||
margin-right: 60upx;
|
||||
vertical-align: middle;
|
||||
height: 142upx;
|
||||
width: 200upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.address {
|
||||
padding: 20upx 30upx;
|
||||
border-bottom: 4upx solid #F2F2F2;
|
||||
|
||||
.dizhi_img {
|
||||
margin-right: 30upx;
|
||||
height: 27upx;
|
||||
width: 20upx;
|
||||
}
|
||||
|
||||
.pop_right {
|
||||
height: 22upx;
|
||||
width: 13upx;
|
||||
|
||||
}
|
||||
|
||||
.goods_count {
|
||||
// position: absolute;
|
||||
// bottom: -14upx;
|
||||
// right: 8upx;
|
||||
}
|
||||
}
|
||||
|
||||
.pop_sure {
|
||||
line-height: 82upx;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
772
金壶/appV1/pages/shoppingCart/shoppingCart.vue
Normal file
772
金壶/appV1/pages/shoppingCart/shoppingCart.vue
Normal file
@@ -0,0 +1,772 @@
|
||||
<template>
|
||||
<!-- 购物车 页面 -->
|
||||
<view class="content w-100 h-100">
|
||||
<view class="header bg-linear-gradient x-text-white text-center">
|
||||
购物车
|
||||
<view class="edit_shoppingCar" @click="edit_shoppingCar()" v-if="isEdit==false">管理</view>
|
||||
<view class="edit_shoppingCar" @click="edit_shoppingCar()" v-if="isEdit==true">完成</view>
|
||||
</view>
|
||||
<view v-if='available_goods.length<=0' align="center">
|
||||
<image src="../../static/no/u/carno.png" mode="" class="noCar_img"></image>
|
||||
</view>
|
||||
<view class="list" v-if='available_goods.length>0'>
|
||||
<view class="list_items" v-for="(item,index) in available_goods" :key="index" v-if="available_goods.length>0">
|
||||
<checkbox-group class="block" style='padding:0 30upx 30upx'>
|
||||
<view class=" d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="uni-list">
|
||||
<checkbox-group @change="selected(item)">
|
||||
<checkbox class="xuanzhong" :checked="item.checked" />
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<!-- <view class="box_img" @click="goodsDetail(index)">
|
||||
<an-image :src="'https://'+item.pc_thumb" alt="https://ydyd-develop-file.oss-cn-hangzhou.aliyuncs.com/imageerror.jpg"></an-image>
|
||||
|
||||
</view> -->
|
||||
<view class="box_img" @click="goodsDetail(index)" :style="{backgroundImage: 'url(' + 'https://'+item.pc_thumb + ')', backgroundSize:'contain',backgroundPosition:'center'}">
|
||||
|
||||
</view>
|
||||
<view class="goods_txt flex-1" style="width:60%;">
|
||||
<view class="font-weight d-flex a-center">
|
||||
<image src="../../static/shoppingCart/xian.png" mode="" class="" style="height:30upx; width:30upx; margin-right:30upx;" v-if='item.is_limit==1'></image>
|
||||
<image src="../../static/shoppingCart/re.png" mode="" style="height:30upx; width:30upx;margin-right:30upx;" v-if='item.supplier_id<=10000'></image>
|
||||
<view class="textOVerFlow flex-1">{{item.name}}</view>
|
||||
</view>
|
||||
<view v-if='item.is_limit==1' class="x-text-159">{{item.limit_info}}</view>
|
||||
<view class="x_text_hui zhuyi_title">{{item.manufacturer_name}}</view>
|
||||
<view class="d-flex a-center">
|
||||
<view class="x_text_hui zhuyi_title">{{item.spec_desc}}</view>
|
||||
</view>
|
||||
<view class="d-flex a-center">
|
||||
<view class="x_text_hui">{{item.retail_flag==1?item.entirety_num:item.retail_num}}{{item.unit}}/件</view>
|
||||
<image src="../../static/shoppingCart/zheng.png" mode="" style="height:30upx; width:30upx;margin:0 30upx;" v-if="item.retail_flag==1" class=""></image>
|
||||
<image src="../../static/shoppingCart/ling.png" mode="" style="height:30upx; width:30upx; margin:0 30upx;" v-if="item.retail_flag==0" class=""></image>
|
||||
</view>
|
||||
|
||||
<view class="x-text-159 font-weight font_28">¥{{item.price}}</view>
|
||||
</view>
|
||||
<view class="goods_count d-flex">
|
||||
<view class="bianji_cars_num bianji_cars_num bianji_cars_numJian" @click="reduce(item)">-</view>
|
||||
<view class=" bianji_cars_numAdd">
|
||||
<input type="number" value="" cursor-spacing="30" class=" uni-input change-w bianji_cars_num w-100 text-center" style="padding:0;" v-model="item.num"
|
||||
@blur="outComputeNum(item,index)" @focus="inComputeNum(item)" @input="changeInput($event,item,index)" />
|
||||
</view>
|
||||
<view class="bianji_cars_num " @click="add(item)">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<!-- <view class="list_items" v-for="(item,index) in inavailable_goods" :key="index" v-if="inavailable_goods.length>0">
|
||||
<checkbox-group class="block" @change="changeCheckbox" style='padding:0 30upx 30upx'>
|
||||
<view class=" d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="uni-list">
|
||||
<checkbox-group @change="selected(item)">
|
||||
<checkbox class="xuanzhong" :checked="item.checked" />
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="box_img" @click="goodsDetail(index)">
|
||||
<image :src="'https://'+item.pc_thumb" mode="" class="h-100 w-100" v-if="item.pc_thumb!=''"></image>
|
||||
<image src="../../static/noimg.png" mode="" class="h-100 w-100" v-if="item.pc_thumb==''"></image>
|
||||
</view>
|
||||
<view class="goods_txt flex-1" @click="goodsDetail(index)">
|
||||
<view class="font-weight">{{item.name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="">{{item.spec_desc}} {{item.retail_flag==1?'整':'零'}}</view>
|
||||
<view class="x-text-159">¥ {{item.price}}</view>
|
||||
</view>
|
||||
<view class="goods_count d-flex">
|
||||
<view class="bianji_cars_num bianji_cars_numJian" @click="reduce(item)">-</view>
|
||||
<view class="bianji_cars_num bianji_cars_numAdd" style="padding:0;">{{item.num}}</view>
|
||||
<view class="bianji_cars_num bianji_cars_numAdd" @click="add(item)">+</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</checkbox-group>
|
||||
<view class="line"></view>
|
||||
</view> -->
|
||||
|
||||
</view>
|
||||
<view class="settlement shadow d-flex a-center" v-if="isEdit==false && available_goods.length>0">
|
||||
<view class="all_choose">
|
||||
<checkbox-group @change="selectedall()">
|
||||
<checkbox class="quanxuananniu" :checked="allchecked" />全选
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="x_textRight flex-1 d-flex text-right">
|
||||
<view>总计:</view>
|
||||
<view class="x-text-159">¥ {{Math.round(is_conut * 100) / 100}}</view>
|
||||
<!-- <view class="">¥ {{totel}}</view> -->
|
||||
|
||||
</view>
|
||||
<view class="x-bg-159 to_buy text-center x-text-white" @click="to_pay()">去结算({{jianshu}})件</view>
|
||||
</view>
|
||||
<view class="settlement shadow d-flex a-center" v-if="isEdit==true && available_goods.length>0">
|
||||
<view class="all_choose">
|
||||
<checkbox-group @change="selectedall()">
|
||||
<checkbox class="quanxuananniu" :checked="allchecked" />全选
|
||||
</checkbox-group>
|
||||
</view>
|
||||
<view class="text-center add_toCollection" @click="add_collage()">移入收藏夹</view>
|
||||
<view class="x-bg-159 text-center del_goods" @click="del()">删除</view>
|
||||
</view>
|
||||
<view class="no_list x_margin0auto" v-if="list.length>0">
|
||||
<image src="../../static/shoppingCart/nopic.png" mode="" class="no_list_img"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations, mapGetters } from 'vuex'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import {
|
||||
Config
|
||||
} from '../../utils/config.js'
|
||||
import auth from '../../utils/models/auth.js'
|
||||
import anImage from '@/components/an-image/an-image'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goods_num: 0, //商品当前数量
|
||||
Stock: 20, //当前商品的总库存
|
||||
isEdit: false, // 判断是否编辑购物车,true为编辑,false为不编辑
|
||||
add_choose_checked: false,
|
||||
list: [], // 购物车数据
|
||||
isChecked: false,
|
||||
checkedArr: [], //复选框选中的值
|
||||
allChecked: false, //是否全选
|
||||
flag: true, // 用于判断用户购物车是否有商品,没有商品为true,有商品为false
|
||||
//cartlist: [], // 购物车商品信息
|
||||
allchecked: false, //默认全选为true,因为后台数据没有是否选中的信息
|
||||
available_goods: '', //正常的购物车数据
|
||||
inavailable_goods: '', //非正常的购物车数据(下架,失效等等)
|
||||
chooseArr: [], // 被选择的商品列表的id的数组
|
||||
id: '', //
|
||||
batch_id: '',
|
||||
goods_id: '',
|
||||
collageGoods_id: '', //加入收藏夹的goods_id 的集合
|
||||
result: [],
|
||||
result_list: [],
|
||||
jianshu: 0,
|
||||
is_conut: 0, // 总计
|
||||
old_num: 0,
|
||||
is_next: true,
|
||||
change_jiage:[]
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop,
|
||||
anImage
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.goods_num) {
|
||||
this.goods_num = option.goods_num
|
||||
}
|
||||
this.allchecked = false
|
||||
},
|
||||
onShow() {
|
||||
this.is_conut = 0;
|
||||
this.jianshu = 0;
|
||||
this.allchecked = false;
|
||||
this.shoppingCarList();
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
'SetShopCarNums'
|
||||
]),
|
||||
// 监听input值的变化,计算总价格
|
||||
async changeInput(event, item, index) {
|
||||
|
||||
item.num = event.detail.value
|
||||
if(item.num=='' || item.num==0 || item.num * 100 == 0){
|
||||
item.num = 0
|
||||
//item.checked = false
|
||||
}
|
||||
},
|
||||
inComputeNum(item) {
|
||||
this.is_next = false
|
||||
this.old_num = item.num
|
||||
},
|
||||
|
||||
async outComputeNum(item, index) {
|
||||
if(item.num=='' || item.num==0 || item.num * 100 == 0){
|
||||
item.num = 0
|
||||
}
|
||||
if (item.retail_flag == 0) { //零售
|
||||
let num = Math.ceil(item.num / item.retail_num)
|
||||
if (num > 0) {
|
||||
item.num = num * item.retail_num
|
||||
if (item.stock_num < item.num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
item.num = item.stock_num;
|
||||
}
|
||||
}
|
||||
} else { // 整售
|
||||
let num = Math.ceil(item.num / item.entirety_num)
|
||||
if (num > 0) {
|
||||
item.num = num * item.entirety_num
|
||||
if (item.stock_num < item.num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
|
||||
item.num = item.stock_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let res = await X_goods.X_update(item.id, item.num)
|
||||
this.is_next = true
|
||||
this.handleError(res, res => {
|
||||
if(res.data.errcode == 0){
|
||||
|
||||
if (item.checked) {
|
||||
if(this.old_num > item.num){
|
||||
this.is_conut -= Number(this.old_num - item.num) * item.price
|
||||
}
|
||||
if(this.old_num < item.num){
|
||||
|
||||
this.is_conut += Number(item.num - this.old_num) * item.price
|
||||
}
|
||||
}
|
||||
// if(item.num == 0){
|
||||
// item.checked = false
|
||||
// }
|
||||
}
|
||||
|
||||
if (res.data.errcode != 0) {
|
||||
item.num = this.old_num ;
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
})
|
||||
},
|
||||
//移入收藏夹
|
||||
async add_collage() {
|
||||
this.collageGoods_id = ''
|
||||
this.available_goods.forEach(item => {
|
||||
if (item.checked == true) {
|
||||
this.collageGoods_id += item.goods_id + ','
|
||||
}
|
||||
})
|
||||
this.collageGoods_id = this.collageGoods_id.substr(0, this.collageGoods_id.length - 1);
|
||||
|
||||
if (this.collageGoods_id.length <= 0) {
|
||||
|
||||
uni.showToast({
|
||||
title: '请选择商品',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
let res = await X_goods.X_addCollect_app(this.collageGoods_id, 1)
|
||||
this.handleError(res, res => {
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
// 减号操作
|
||||
async reduce(item) {
|
||||
if (item.num < 0) {
|
||||
uni.showToast({
|
||||
title: '数量不得为负',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
item.num = 0
|
||||
|
||||
return
|
||||
}else if(item.num ==0){
|
||||
// item.checked = false
|
||||
return
|
||||
} else {
|
||||
if (item.retail_flag == 0) { //零售
|
||||
// item.num -= item.retail_num
|
||||
item.num = Number(item.num) - Number(item.retail_num)
|
||||
if (item.checked) {
|
||||
this.is_conut -= Number(item.retail_num) * item.price
|
||||
}
|
||||
} else { // 整售
|
||||
// item.num -= item.entirety_num
|
||||
item.num = Number(item.num) - Number(item.entirety_num)
|
||||
if (item.checked) {
|
||||
this.is_conut -= Number(item.entirety_num) * item.price
|
||||
}
|
||||
}
|
||||
|
||||
if (item.num < 0) {
|
||||
item.num = 0
|
||||
uni.showToast({
|
||||
title: '数量不得为负',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
let res = await X_goods.X_update(item.id, item.num)
|
||||
// this.shoppingCarList();
|
||||
this.handleError(res, res => {
|
||||
if (res.data.errcode != 0) {
|
||||
if (item.retail_flag == 0) { //零售
|
||||
item.num += item.retail_num
|
||||
if (item.checked) {
|
||||
this.is_conut += Number(item.retail_num) * item.price
|
||||
}
|
||||
|
||||
} else { // 整售
|
||||
item.num += item.entirety_num
|
||||
if (item.checked) {
|
||||
this.is_conut += Number(item.entirety_num) * item.price
|
||||
}
|
||||
}
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
// 加号操作
|
||||
async add(item) {
|
||||
if (item.stock_num <= this.goods_num) {
|
||||
uni.showToast({
|
||||
title: '库存不足',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.goods_num = item.stock_num;
|
||||
} else {
|
||||
if (item.retail_flag == 0) { //零售
|
||||
item.num = Number(item.num) + Number(item.retail_num)
|
||||
if (item.checked) {
|
||||
this.is_conut += Number(item.retail_num) * item.price
|
||||
}
|
||||
} else { // 整售
|
||||
item.num = Number(item.num) + Number(item.entirety_num)
|
||||
if (item.checked) {
|
||||
this.is_conut += Number(item.entirety_num) * item.price
|
||||
}
|
||||
}
|
||||
let res = await X_goods.X_update(item.id, item.num)
|
||||
|
||||
|
||||
this.handleError(res, res => {
|
||||
|
||||
if (res.data.errcode != 0) {
|
||||
if (item.retail_flag == 0) { //零售
|
||||
item.num -= item.retail_num
|
||||
if (item.checked) {
|
||||
this.is_conut -= Number(item.retail_num) * item.price
|
||||
}
|
||||
|
||||
} else { // 整售
|
||||
item.num -= item.entirety_num
|
||||
if (item.checked) {
|
||||
this.is_conut -= Number(item.entirety_num) * item.price
|
||||
}
|
||||
}
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 删除单挑购物车商品
|
||||
async del() {
|
||||
this.chooseArr = []
|
||||
this.available_goods.forEach(item => {
|
||||
if (item.checked == true) {
|
||||
this.chooseArr.push(item.id)
|
||||
}
|
||||
})
|
||||
if (this.chooseArr.length <= 0) {
|
||||
uni.showToast({
|
||||
title: '请选择商品',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
let res = await X_goods.X_delCar(this.chooseArr)
|
||||
this.isEdit = !this.isEdit;
|
||||
this.handleError(res, res => {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
this.is_conut = 0;
|
||||
this.jianshu = 0;
|
||||
this.shoppingCarList();
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 单个商品前的勾选
|
||||
selected(item) {
|
||||
// if(item.num==0){
|
||||
// // item.checked =false
|
||||
// }else{
|
||||
// }
|
||||
item.checked = !item.checked
|
||||
if (!item.checked) {
|
||||
this.allchecked = false
|
||||
this.jianshu--
|
||||
this.is_conut -= (item.price * item.num)
|
||||
} else {
|
||||
this.jianshu++
|
||||
|
||||
this.is_conut += (item.price * item.num)
|
||||
const test = this.available_goods.every(item => {
|
||||
return item.checked === true
|
||||
})
|
||||
if (test) {
|
||||
this.allchecked = true
|
||||
} else {
|
||||
this.allchecked = false
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
// 全选按钮
|
||||
selectedall() {
|
||||
this.jianshu = 0;
|
||||
this.is_conut = 0;
|
||||
if (this.available_goods.length <= 0) {
|
||||
return
|
||||
} else {
|
||||
this.allchecked = !this.allchecked
|
||||
if (this.allchecked) {
|
||||
this.available_goods.map(item => {
|
||||
item.checked = true
|
||||
this.is_conut += item.price * item.num
|
||||
// this.is_conut++
|
||||
})
|
||||
this.jianshu = this.available_goods.length
|
||||
} else {
|
||||
this.available_goods.map(item => {
|
||||
item.checked = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//去结算 X_orderPreview
|
||||
async to_pay() {
|
||||
if (!this.is_next) {
|
||||
return
|
||||
}
|
||||
|
||||
this.goods_id = ''
|
||||
for (let i = 0; i < this.available_goods.length; i++) {
|
||||
if (this.available_goods[i].checked == true) {
|
||||
if(this.available_goods[i].num==0){
|
||||
uni.showToast({
|
||||
title: '请选择商品数量',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
return
|
||||
}else{
|
||||
this.goods_id += this.available_goods[i].id + ','
|
||||
}
|
||||
}
|
||||
}
|
||||
this.goods_id = this.goods_id.substr(0, this.goods_id.length - 1);
|
||||
|
||||
if (this.goods_id.length <= 0) {
|
||||
|
||||
} else {
|
||||
this.goodid();
|
||||
this.is_checkAuth()
|
||||
// if (this.the_checkAuth == 'finish') {
|
||||
// uni.navigateTo({
|
||||
// url: './sureOrder?goods_id=' + this.goods_id
|
||||
// })
|
||||
// }
|
||||
|
||||
}
|
||||
},
|
||||
goodid(){
|
||||
this.$store.commit('goodid',this.goods_id)
|
||||
},
|
||||
//checkAuth 检测用户是否完成认证
|
||||
async is_checkAuth() {
|
||||
let res = await auth.checkAuth()
|
||||
|
||||
this.the_checkAuth = res.data
|
||||
if (res.data != 'finish') {
|
||||
if (res.data == 'auditing') {
|
||||
uni.showToast({
|
||||
title: '您的企业认证正在审核中!',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '请先完成认证',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.redirectTo({
|
||||
url: '../auth/baisc'
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
uni.navigateTo({
|
||||
url: './sureOrder?goods_id=' + this.goods_id
|
||||
})
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
|
||||
})
|
||||
},
|
||||
// 购物车列表
|
||||
async shoppingCarList() {
|
||||
this.available_goods = []
|
||||
let res = await X_goods.x_shoppingCar()
|
||||
// if (res.code == 40000) {
|
||||
// uni.navigateTo({
|
||||
// url: './x_login'
|
||||
// })
|
||||
// }
|
||||
this.handleError(res, res => {
|
||||
|
||||
if (res.data == '') {
|
||||
|
||||
} else {
|
||||
this.available_goods = res.data.data.available_goods;
|
||||
this.SetShopCarNums(this.available_goods.length)
|
||||
// Config.shooppingCar_num = this.available_goods.length
|
||||
// this.inavailable_goods = res.data.data.inavailable_goods
|
||||
this.available_goods.map(item => {
|
||||
item.checked = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 管理购物车
|
||||
edit_shoppingCar() {
|
||||
this.isEdit = !this.isEdit
|
||||
},
|
||||
// 进入商品详情页
|
||||
goodsDetail(index) {
|
||||
|
||||
if (this.isEdit == false) {
|
||||
|
||||
if (this.available_goods[index].price_id) {
|
||||
uni.navigateTo({
|
||||
url: './goodsDetail?sku_id=' + this.available_goods[index].price_id + '&goods_num=' + this.available_goods[
|
||||
index].num
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
// 登录
|
||||
to_login() {
|
||||
uni.navigateTo({
|
||||
url: 'x_login'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.header {
|
||||
height: 148upx;
|
||||
font-size: 32upx;
|
||||
position: relative;
|
||||
line-height: 194upx;
|
||||
|
||||
.edit_shoppingCar {
|
||||
position: absolute;
|
||||
bottom: -48upx;
|
||||
right: 31upx;
|
||||
}
|
||||
}
|
||||
|
||||
.noCar_img {
|
||||
height: 238upx;
|
||||
width: 350upx;
|
||||
margin-top: 100upx;
|
||||
}
|
||||
|
||||
.cartlist {
|
||||
background-color: #999999;
|
||||
padding: 10px;
|
||||
|
||||
.cartitem {
|
||||
background-color: #FFFFFF;
|
||||
height: 50px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.xuanzhong {
|
||||
float: left;
|
||||
line-height: 50px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
image {
|
||||
display: inline-block;
|
||||
height: 40px;
|
||||
width: 40px;
|
||||
padding: 5px 0;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.itemright {
|
||||
display: inline-block;
|
||||
padding: 5px;
|
||||
|
||||
.del {
|
||||
margin-left: 10px;
|
||||
background-color: red;
|
||||
color: #FFFFFF;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.list {
|
||||
|
||||
height: calc(100% - 248upx);
|
||||
|
||||
overflow-y: auto;
|
||||
|
||||
|
||||
.list_items {
|
||||
|
||||
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
// width: 270upx;
|
||||
width:40%;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
overflow: hidden;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
position: relative;
|
||||
|
||||
.goods_count {
|
||||
position: absolute;
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
.change-w{
|
||||
width:65upx;
|
||||
}
|
||||
.bianji_cars_num{
|
||||
background: #FBFBFB;
|
||||
}
|
||||
.bianji_cars_numAdd{
|
||||
margin-left: 2upx;
|
||||
margin-right: 2upx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.no_list {
|
||||
margin-top: 315upx;
|
||||
text-align: center;
|
||||
|
||||
.no_list_img {
|
||||
height: 198upx;
|
||||
width: 395upx;
|
||||
}
|
||||
}
|
||||
|
||||
.settlement {
|
||||
height: 100upx;
|
||||
|
||||
.all_choose {
|
||||
width: 30%;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
|
||||
.to_buy {
|
||||
line-height: 100upx;
|
||||
width: 260upx;
|
||||
min-width: 224.6upx;
|
||||
font-size: 34upx;
|
||||
}
|
||||
|
||||
.add_toCollection {
|
||||
border: 1upx solid #EDCA4A;
|
||||
border-radius: 30upx;
|
||||
height: 60upx;
|
||||
line-height: 60upx;
|
||||
width: 198.8upx;
|
||||
color: #EDCA4A;
|
||||
margin: 0 22px 0 30px;
|
||||
}
|
||||
|
||||
.del_goods {
|
||||
border: 1upx solid #EB5159;
|
||||
border-radius: 30upx;
|
||||
height: 60upx;
|
||||
line-height: 60upx;
|
||||
width: 150upx;
|
||||
color: #EB5159;
|
||||
border: 1upx solid #EB5159;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
363
金壶/appV1/pages/shoppingCart/sureOrder.vue
Normal file
363
金壶/appV1/pages/shoppingCart/sureOrder.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<!-- 确认订单 页面 -->
|
||||
<view class="content">
|
||||
<HeaderTop page_title='确认订单'></HeaderTop>
|
||||
<view class="detail bg_F2F2F2">
|
||||
<view class="x-bg-white margin-bottom22">
|
||||
<!-- 传参地址 -->
|
||||
<view class="padding-30" v-if="option_address!==''">
|
||||
<view class="goods_info d-flex j-sb w-50">
|
||||
<view class="font_28">{{address.consignee}}</view>
|
||||
<view class="">{{address.tel}}</view>
|
||||
</view>
|
||||
<view class="goods_info d-flex j-sb a-center" @click="to_addAdress()">
|
||||
<view class="font_28 w-90">
|
||||
{{address.address}}</view>
|
||||
<image src="../../static/shoppingCart/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 接口地址 -->
|
||||
<view class="padding-30" v-if="address!='' && option_address==''">
|
||||
<view class="goods_info d-flex j-sb w-50">
|
||||
<view class="font_28">{{address.consignee}}</view>
|
||||
<view class="">{{address.tel}}</view>
|
||||
</view>
|
||||
<view class="goods_info d-flex j-sb a-center" @click="to_addAdress()">
|
||||
<view class="font_28 w-90">
|
||||
{{address.address}}</view>
|
||||
<image src="../../static/shoppingCart/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 没有地址 -->
|
||||
<view class="padding-30" v-if="(address.address=='' || address.address==null) && option_address==''">
|
||||
<view class="goods_info d-flex j-sb a-center" @click="to_addAdress()">
|
||||
<view class="font_28 w-90">
|
||||
暂无地址</view>
|
||||
<image src="../../static/shoppingCart/right.png" mode="" class="p_right"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list x-bg-white margin-bottom22 padding-sx30">
|
||||
<view class="list_items" v-if='goods_list' v-for="(item,index) in goods_list" :key="item.index">
|
||||
<view class=" d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="shixiao" v-if='item.is_buy==0'>失效</view>
|
||||
<view class="box_img">
|
||||
<image :src="item.app_thumb" mode="" class="h-100 w-100"></image>
|
||||
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">{{item.goods_name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="">{{item.spec_desc}} {{item.unit}}</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x-text-159">¥ {{item.unit_price}}</view>
|
||||
<view class="">X {{item.goods_number}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list_items" v-for="(item,index) in extend" :key="item.index">
|
||||
<view class=" d-flex a-center">
|
||||
<view class="d-flex goods_items a-center w-100">
|
||||
<view class="shixiao" v-if='item.is_buy==0'>失效</view>
|
||||
<view class="box_img">
|
||||
<image :src="item.app_thumb" mode="" class="h-100 w-100"></image>
|
||||
|
||||
</view>
|
||||
<view class="goods_txt flex-1 padding-zy30">
|
||||
<view class="font-weight">{{item.goods_name}}</view>
|
||||
<view class="">{{item.manufacturer_name}}</view>
|
||||
<view class="">{{item.spec_desc}} {{item.unit}}</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x-text-159">¥ {{item.unit_price}}</view>
|
||||
<view class="">X {{item.goods_number}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bg-white margin-bottom22 padding-30">
|
||||
<view class="d-flex j-sb">
|
||||
<view>商品总额</view>
|
||||
<view class="x-text-159">¥ {{list.goods_amount}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view>运费</view>
|
||||
<view class="x-text-159">¥ {{list.shipping_fee}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb">
|
||||
<view class="x_text_hui" style="margin-bottom: 30upx;">{{list.shipping_fee_text}}</view>
|
||||
</view>
|
||||
<view class="d-flex j-sb a-center ">
|
||||
<view class="">订单备注</view>
|
||||
<input type="text" value="" class="the_remarks flex-1" v-model="remark" placeholder="如有其他备注内容,请在此填写"/>
|
||||
<!-- <textarea placeholder-style="color:#989898" placeholder="如有其他备注内容,请在此填写" v-model="remark"class="the_remarks" /> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom_menu shadow d-flex">
|
||||
<view class="flex-1 x_textRight padding-zy30">
|
||||
<text class="x_text_hui">共{{list.total_number}}件,</text>
|
||||
<text class="x_text_hei2828 margin-zy20 font-weight" @click="shishi" >合计:</text>
|
||||
<text class="x-text-159">¥ {{list.total_amount}}</text>
|
||||
</view>
|
||||
<view class="buy sameBtn x-text-white text-center" v-if="list.is_buy==0" style="background-color: #a9a1a1;">提交订单</view>
|
||||
<view class="buy sameBtn x-text-white text-center" v-if="list.is_buy!==0" @click="submitOrder()">提交订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import store from '@/store/index.js'
|
||||
// import Vuex from "vuex"
|
||||
import X_goods from '../../utils/models/goods.js'
|
||||
import HeaderTop from '../../components/HeaderTop/HeaderTop.vue'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
goods_num: 10, // 商品的当前数量
|
||||
Stock: 100, //当前商品的总库存
|
||||
sales_type: 10, //销售类型
|
||||
is_collection: false, //判断是否收藏商品 是:true ; 否:false
|
||||
is_pop_show: false, // 判断购物车遮挡层的状态 显示:true ; 隐藏:false
|
||||
Which_one: '', //判断用户点击了哪一个按钮 1:加入购物车; 2:立即购买
|
||||
car_GoodsNum: 0 ,//购物车的商品数量
|
||||
goods_id:'', // 购物车ID(传过来的参数)
|
||||
address:'',
|
||||
goods_list:'',
|
||||
extend:'',
|
||||
list:'',
|
||||
remark:'' ,//备注
|
||||
option_address:'', //从地址列表页传参
|
||||
goods_ids:'' // 订单id的集合
|
||||
}
|
||||
},
|
||||
comments: {
|
||||
HeaderTop
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
this.sure_order()
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
this.goods_id = option.goods_id
|
||||
|
||||
if(option.address){
|
||||
this.option_address = option.address
|
||||
|
||||
|
||||
}else{
|
||||
this.address = ''
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
//添加收货地址
|
||||
goodid(){
|
||||
this.$store.commit('goodid',this.goods_id)
|
||||
},
|
||||
to_addAdress(){
|
||||
this.goodid();
|
||||
uni.redirectTo({
|
||||
url:'../my/user-path-list?goods_id='+this.goods_id
|
||||
})
|
||||
},
|
||||
|
||||
// shishi(){
|
||||
// console.log(this.$store.state.goods_id)
|
||||
// },
|
||||
//确认订单 X_orderPreview
|
||||
async sure_order() {
|
||||
this.goods_id = this.$store.state.goods_id
|
||||
let res = await X_goods.X_orderPreview(this.goods_id)
|
||||
this.handleError(res, res => {
|
||||
|
||||
if(res.data.address){
|
||||
|
||||
if(this.option_address){
|
||||
|
||||
this.address = JSON.parse(this.option_address)
|
||||
}else{
|
||||
|
||||
this.address = res.data.address
|
||||
}
|
||||
}
|
||||
|
||||
this.goods_list = res.data.goods_list.plat
|
||||
this.extend = res.data.goods_list.extend
|
||||
this.list = res.data
|
||||
if(!this.address){
|
||||
uni.showToast({
|
||||
title: '请选择收货地址',
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
//提交订单 (创建订单)
|
||||
async submitOrder(){
|
||||
this.goodid();
|
||||
if(this.list.is_buy==1){
|
||||
this.goods_ids = ''
|
||||
if(this.goods_list){
|
||||
this.goods_list.forEach(item=>{
|
||||
this.goods_ids+=item.id+','
|
||||
})
|
||||
}
|
||||
if(this.extend){
|
||||
this.extend.forEach(item=>{
|
||||
this.goods_ids+=item.id+','
|
||||
})
|
||||
}
|
||||
this.goods_ids = this.goods_ids.substr(0, this.goods_ids.length - 1);
|
||||
let res = await X_goods.X_create_order(this.goods_ids,this.address.address,this.address.consignee,this.address.tel,this.remark,this.address.id)
|
||||
if(res.code==200){
|
||||
if(res.data.errcode){
|
||||
uni.showToast({
|
||||
title: res.data.errmsg,
|
||||
duration: 2000,
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(function() {
|
||||
uni.switchTab({
|
||||
url: './shoppingCart'
|
||||
})
|
||||
}, 1500);
|
||||
}else{
|
||||
uni.redirectTo({
|
||||
url:'../my/pay_type?order_id='+res.data.order_id
|
||||
})
|
||||
}
|
||||
}
|
||||
this.handleError(res, res => {
|
||||
})
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.content {
|
||||
.the_remarks{
|
||||
font-size: 28upx;
|
||||
}
|
||||
overflow-y: auto;
|
||||
.detail {
|
||||
background-color: #F2F2F2;
|
||||
height: calc(100% - 249upx);
|
||||
overflow-y: auto;
|
||||
.list {
|
||||
|
||||
.list_items {
|
||||
position: relative;
|
||||
.shixiao{
|
||||
position: absolute;
|
||||
right:6%;
|
||||
top:0;
|
||||
padding:5upx 10upx;
|
||||
border-radius: 20upx;
|
||||
background-color: #a9a1a1;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.box_img {
|
||||
height: 153.3upx;
|
||||
width: 270upx;
|
||||
background-color: #F2F2F2;
|
||||
padding: 10upx 20upx;
|
||||
margin: 0 10upx;
|
||||
}
|
||||
|
||||
.goods_items {
|
||||
position: relative;
|
||||
|
||||
.goods_count {
|
||||
position: absolute;
|
||||
bottom: -14upx;
|
||||
right: 8upx;
|
||||
}
|
||||
}
|
||||
.line {
|
||||
height: 4upx;
|
||||
background-color: #F2F2F2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.goods_txt {
|
||||
.txt_info {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
padding: 0 15upx;
|
||||
border-radius: 10upx;
|
||||
margin: 0 15upx;
|
||||
}
|
||||
|
||||
.zhuyi_title {
|
||||
margin: 20upx 0 20upx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.bottom_menu {
|
||||
height: 100upx;
|
||||
overflow: hidden;
|
||||
line-height: 100upx;
|
||||
.car_img {
|
||||
height: 41upx;
|
||||
width: 46upx;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.car_txt {
|
||||
font-size: 20upx;
|
||||
color: #989898;
|
||||
line-height: 22upx;
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.car_GoodsNum {
|
||||
position: absolute;
|
||||
top: -8upx;
|
||||
left: 108upx;
|
||||
color: #EB5159;
|
||||
}
|
||||
|
||||
.sameBtn {
|
||||
line-height: 81.5upx;
|
||||
width: 38%;
|
||||
}
|
||||
|
||||
.the_car {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.add_shopping_car {
|
||||
background-color: #EDCA4A;
|
||||
}
|
||||
|
||||
.buy {
|
||||
background-color: #EB5159;
|
||||
line-height: 100upx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user