Browse Source

文创

master
jiazhipeng 5 months ago
parent
commit
e36c84a9f1
  1. 398
      components/addressAdd.vue
  2. 455
      components/cartData.vue
  3. 265
      components/contactAdd.vue
  4. 11
      package-lock.json
  5. 19
      package.json
  6. 19
      pages.json
  7. 36
      static/css/base.css
  8. 30
      static/js/CommonFunction.js
  9. 129
      static/js/request.js
  10. 507
      subPackages/techan/detail.vue
  11. 456
      subPackages/techan/index.vue
  12. 134
      subPackages/techan/order.vue

398
components/addressAdd.vue

@ -0,0 +1,398 @@
<template>
<view class="bg">
<view class="list-forms">
<view class="list-item">
<view class="list-item-title">姓名</view>
<view class="list-item-input"><input type="text" v-model="username" placeholder="请输入姓名" /></view>
</view>
<view class="list-item">
<view class="list-item-title">手机号</view>
<view class="list-item-input"><input type="number" v-model="mobile" placeholder="请输入手机号" maxlength="11"
/></view>
</view>
<view class="list-item" style="position: relative;">
<view class="list-item-title">选择地区</view>
<view class="list-item-input3" style="flex: 1;">
<picker mode="multiSelector" :range="newProvinceDataList" range-key="name" @change="changeArea" @columnchange="pickerColumnchange"
style="position: relative;z-index: 2;">
<input type="text" readonly style="font-size: 35rpx;position: relative;z-index: -1;"
v-model="citySeld" disabled="true" placeholder="请选择地区"/>
</picker>
</view>
</view>
<view class="list-item">
<view class="list-item-title">详细地址</view>
<view class="list-item-input"><input type="text" v-model="detailAddr" placeholder="请输入详细地址" /></view>
</view>
<view class="list-item" style="border-bottom: 0;">
<view class="list-item-title">设为默认</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#74A5AA"/>
</view>
</view>
<!-- <view class="list-item-btn">
<view class="list-item-post" @click="postSave()">保存</view>
</view> -->
</view>
</view>
</template>
<script>
import District from 'ydui-district/dist/jd_province_city_area_id';
export default {
data() {
return {
username: '',
mobile: '',
citySeld: '',
detailAddr: '',
idDefault: false,
title: '新增收货地址',
show: false,
district: District, //
ready: false,
province: null,
city: null,
area: '',
provinceId: null,
cityId: null,
areaId: null,
columns: [],
id: '',
newProvinceDataList:[
[],[],[]
],
multiIndex: [0, 0, 0],
}
},
onLoad(option){
},
methods: {
init(option) {
this.id = null
this.username = ''
this.mobile = ''
this.citySeld = ''
this.detailAddr = ''
this.idDefault = false
this.province = null
this.city = null
this.area = ''
this.provinceId = null
this.cityId = null
this.areaId = null
this.multiIndex = [0, 0, 0]
this.id = option.id
if (option.id > 0) {
this.title = '编辑收货地址'
this.getDetail()
}
else {
this.getSeldCityList()
}
},
switchChange(e){
this.idDefault = e.detail.value
},
changeArea(e){
//
this.multiIndex = e.detail.value;
this.citySeld = this.newProvinceDataList[0][this.multiIndex[0]].name + this.newProvinceDataList[1][this.multiIndex[1]].name + this.newProvinceDataList[2][this.multiIndex[2]].name
this.provinceId = this.newProvinceDataList[0][this.multiIndex[0]].id
this.cityId = this.newProvinceDataList[1][this.multiIndex[1]].id
this.areaId = this.newProvinceDataList[2][this.multiIndex[2]].id
},
getSeldCityList() {
if (this.columns.length>0) {
return
}
let that = this
that.Post({}, '/api/areas/getAll').then(res => {
if (res.code === 1) {
var data = res.data;
var result = {};
for (var i = 0; i < data.length; i++) {
var item = data[i];
if (item.parent_id == 0) {
continue;
}
//
if (item.parent_id == "1") {
result[item.id.toString()] = {};
result[item.id.toString()].children = []
result[item.id.toString()].name = item.name;
result[item.id.toString()].id = item.id;
} else if (result[item.parent_id.toString()]) {
//
var t = {
id: item.id,
name: item.name,
children: []
}
result[item.parent_id.toString()].children.push(t)
} else {
//
var k = {
id: item.id,
name: item.name
}
for (var j = 0; j < result[item.parent_id.toString().substr(0, 2) + "0000"].children
.length; j++) {
if (result[item.parent_id.toString().substr(0, 2) + "0000"].children[j].id == item
.parent_id) {
result[item.parent_id.toString().substr(0, 2) + "0000"].children[j].children.push(k)
}
}
}
}
var r = [];
//ObjectArray
for (var i in result) {
r.push(result[i]);
}
//
that.district = r;
let arr = []
let arr1 = []
let arr2 = []
that.district.forEach(item => {
arr.push(item)
})
that.district[0].children.forEach(item => {
arr1.push(item)
})
that.district[0].children[0].children.forEach(item => {
arr2.push(item)
})
that.columns = arr
//
that.ready = true;
console.log(this.columns)
for(let i=0; i<this.columns.length; i++){
this.newProvinceDataList[0].push({name:this.columns[i].name,id:this.columns[i].id});
}
console.log(this.columns[0].children)
for(let i=0; i<this.columns[0].children.length; i++){
this.newProvinceDataList[1].push({name:this.columns[0].children[i].name,id:this.columns[0].children[i].id});
}
for(let i=0; i<this.columns[0].children[0].children.length; i++){
this.newProvinceDataList[2].push({name:this.columns[0].children[0].children[i].name,id:this.columns[0].children[0].children[i].id});
}
}
})
},
//
pickerColumnchange(e){
//
// console.log(e.detail.column);
//
// console.log(e.detail.value)
//
if(e.detail.column === 0){
this.multiIndex[0] = e.detail.value
// console.log('');
// this.newProvinceDataList[1] = [];
this.newProvinceDataList[1] = this.columns[this.multiIndex[0]].children.map((item,index)=>{
// console.log(item)
return item
})
// console.log(this.multiIndex)
if(this.columns[this.multiIndex[0]].children.length === 1){
this.newProvinceDataList[2] = this.columns[this.multiIndex[0]].children[0].children.map((item,index)=>{
// console.log(item)
return item
})
}else{
this.newProvinceDataList[2] = this.columns[this.multiIndex[0]].children[this.multiIndex[1]].children.map((item,index)=>{
// console.log(item)
return item
})
}
//
this.multiIndex.splice(1, 1, 0)
this.multiIndex.splice(2, 1, 0)
}
//
if(e.detail.column === 1){
this.multiIndex[1] = e.detail.value
// console.log('');
// console.log(this.multiIndex)
this.newProvinceDataList[2] = this.columns[this.multiIndex[0]].children[this.multiIndex[1]].children.map((item,index)=>{
// console.log(item)
return item
})
//
this.multiIndex.splice(2, 1, 0)
}
//
if(e.detail.column === 2){
this.multiIndex[2] = e.detail.value
// console.log('')
// console.log(this.multiIndex)
}
},
getDetail() {
this.Post({
id: this.id
}, "/api/user/contactDetail").then(res => {
res = res.data;
if (res && res.id > 0) {
this.username = res.name
this.mobile = res.tel
this.idDefault = res.is_default == 1 ? true : false
this.provinceId = res.province_id
this.cityId = res.city_id
this.areaId = res.district_id
this.citySeld = res.province_text + '' + res.city_text + '' + res.district_text
this.detailAddr = res.detail_addr;
this.getSeldCityList();
}
})
},
async postSave() {
this.username = this.username.trim()
this.mobile = this.mobile.trim()
this.detailAddr = this.detailAddr.trim()
if (this.username.length < 1) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
})
return
}
if (this.username.length > 6) {
uni.showToast({
title: '姓名最多6个字',
icon: 'none'
})
return
}
if (!this.IsTel(this.mobile)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return
}
if (this.citySeld.length < 1) {
uni.showToast({
title: '请选择地区',
icon: 'none'
})
return
}
if (this.detailAddr.length < 2) {
uni.showToast({
title: '请输入具体地址',
icon: 'none'
})
return
}
let res = await this.Post({
name: this.username,
tel: this.mobile,
is_default: this.idDefault ? '1' : '0',
province_id: this.provinceId,
city_id: this.cityId,
district_id: this.areaId,
detail_addr: this.detailAddr,
id: this.id || null
},'/api/user/' + (this.id > 0 ? 'edit' : 'add') + 'Consignee')
if(res.code == '1'){
// uni.setStorageSync('addressNow',JSON.stringify(res.data))
uni.showModal({
title: '提示',
content: this.id>0?'编辑成功':'添加成功',
showCancel: false,
})
}else{
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
})
}
return {...res,data: {id: this.id}}
}
}
}
</script>
<style scoped>
.bg {
width: 100%;
height: 100%;
}
.list-forms {
display: flex;
flex-direction: column;
box-sizing: content-box
}
.list-item {
display: flex;
border-bottom: 1rpx solid #D8D8D8;
padding: 30rpx 0;
height: 60rpx;
align-items: center;
box-sizing: content-box
}
.list-item-title {
width: 150rpx;
font-size: 31rpx;
margin-right: 20rpx;
}
.list-item-input {
flex: 1;
}
.list-item-input input {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: 0;
background-color: transparent;
line-height: 31rpx;
font-size: 31rpx;
}
.list-item-input input::placeholder {
font-size: 26rpx;
}
.list-item-switch {
display: flex;
flex: 1;
justify-content: flex-end;
}
.list-item-btn {
display: flex;
justify-content: center;
margin-top: 20rpx;
}
.list-item-post {
display: flex;
color: #FFFFFF;
font-size: 36rpx;
width: 697rpx;
height: 73rpx;
background: linear-gradient(90deg, #F84A56, #FF9834);
border-radius: 37rpx;
justify-content: center;
align-items: center;
margin-top: 725rpx;
}
</style>

455
components/cartData.vue

@ -0,0 +1,455 @@
<template>
<view class="bg">
<uni-popup ref="popup" type="bottom" border-radius="10px 10px 0 0"
:safe-area="true" @change="popChange">
<view class="cart-container" v-if="showCart">
<view class="header-container">
<view class="select-area flex flex-items-center" @click.stop="selectAllGoods">
<view class="select-cycle" v-show="!selectAll"></view>
<view class="select-cycle selected" v-show="selectAll">
<image :src="showImg('/uploads/20241104/3d903e0c2788104b57b4ce5e07ea1de1.png')">
</view>
<view style="padding-left: 26rpx;" >全选</view>
</view>
<view class="delete-area flex flex-items-center" @click.stop="clearAllGoods">
<image :src="showImg('/uploads/20241104/50900c9a5fa5fbdbdee526abc9af4a40.png')"></image>
<view style="padding-left: 8rpx;" >清空</view>
</view>
</view>
<view class="content-container">
<view class="content-item" v-for="(item,i) in cartData" :key="i" :model="cartData">
<view class="flex flex-items-center" @tap.stop="setItemSelect(item)">
<view class="select-cycle" v-show="!item.isSelected"></view>
<view class="select-cycle selected" v-show="item.isSelected">
<image :src="showImg('/uploads/20241104/3d903e0c2788104b57b4ce5e07ea1de1.png')">
</view>
<view style="padding-left: 26rpx;flex:1">
<view class="commodity box" >
<image class="img" :src="showImg(item.Specifications_image)" mode="aspectFill"></image>
<view class="title goods-text-area">
<view class="commodity-info">
<view class="text-overflowRows" style="font-weight: bold;">{{ item.good_name }}</view>
<view class="text-overflowRows" style="font-size: 27rpx;color: #999999;padding-top: 10rpx;">{{ item.Specifications_name }}</view>
</view>
<view class="flex flex-between">
<view class="commodity-price">
<view style="font-size: 40rpx;">{{item.Specifications_money/100}}</view>
</view>
<view class="add-num-area">
<view :class="['ctrl',item.num>1?'':'disabled']" @click.stop="addBuyNum(item,-1,i)" >-</view>
<view>{{item.num}}</view>
<view :class="['ctrl']" @click.stop="addBuyNum(item,1,i)">+</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</uni-popup>
<slot name="content"></slot>
</view>
</template>
<script>
export default {
name: "cartData",
data() {
return {
cartData: [],
showCart: false,
selectAll: false,
canOpenpop: true,
allPrice: {allPrice:0, iNum:0, fNum:'00'},
}
},
props:{
paramData: {
type: Object,
},
},
mounted() {
this.canOpenpop = true
this.refreshData()
uni.$on("updateDataByConnect",this.getDataByConnect)
},
beforeUnmount () {
console.log('触发off')
uni.$off("updateDataByConnect",this.getDataByConnect)
},
beforeDestroy () {
console.log('触发off')
uni.$off("updateDataByConnect",this.getDataByConnect)
},
methods: {
calNum () {
let res = 0
this.cartData.forEach(v=>{
res += v.num
})
return res
},
closePopup() {
this.$refs.popup.close()
this.paramData.showCart = this.showCart
this.$emit('changeParamData', this.paramData)
},
openPop(){
this.$refs.popup.open()
this.paramData.showCart = this.showCart
this.$emit('changeParamData', this.paramData)
},
popChange (e) {
this.showCart = e.show
this.paramData.showCart = this.showCart
this.$emit('changeParamData', this.paramData)
},
getDataByConnect(data) {
if (data.msgType == "updateCartDataInfo") {
this.refreshData(data)
}
},
refreshData (data) {
let selectedData = []
try {
selectedData = JSON.parse(uni.getStorageSync('cartDataInfo'));
} catch(e) {
selectedData = []
}
if (Array.isArray(data) && data.length>0) {
this.cartData = data
this.setAllSelect()
} else {
this.Post({},'/api/shopping/getShoppingList').then(res => {
if (res) {
this.cartData = (res.data || []).map(v=>{return {...v, isSelected:selectedData.includes(v.specifications_id)}})
this.setAllSelect()
}
})
}
},
//
setItemSelect(item) {
item.isSelected = !item.isSelected
// uni.setStorageSync('cartDataInfo', JSON.stringify(this.cartData));
this.setAllSelect()
},
selectAllGoods(){
let goods = this.cartData
if (this.selectAll) {
goods.forEach(v => v.isSelected = false)
this.selectAll = false
} else {
goods.forEach(v => v.isSelected = true)
this.selectAll = true
}
this.setAllSelect()
},
clearAllGoods(){
let _this = this
Promise.all(this.cartData.map(v=>{
return _this.Post({s_id: v.id},'/api/shopping/delShopping')
})).finally(res =>{
this.cartData = []
this.setAllSelect()
})
},
setAllSelect() {
let goods = this.cartData
if(goods.length>0&& goods.every(v => v.isSelected)){
this.selectAll = true
} else {
this.selectAll = false
}
let selectedData = goods.filter(v=>v.isSelected).map(v=>v.specifications_id)
uni.setStorageSync('cartDataInfo', JSON.stringify(selectedData));
this.calAllPrice()
},
addBuyNum(item, num,index){
if (num == -1 && item.num == 1) {
this.Post({s_id: item.id},'/api/shopping/delShopping').then(res =>{
this.cartData.splice(index,1)
this.setAllSelect()
})
} else {
let numData = item.num + num
this.Post({s_id: item.id, num: numData},'/api/shopping/updateShopping').then(res =>{
item.num += num
this.setAllSelect()
})
}
},
calAllPrice () {
let selectedGoods = this.cartData.filter(v=>v.isSelected)
let totalPrice = 0
selectedGoods.forEach(v=>{
totalPrice += v.Specifications_money/100 * v.num
})
totalPrice = totalPrice.toFixed(2)
console.log(totalPrice)
this.allPrice = {allPrice: totalPrice, iNum: totalPrice.split('.')[0], fNum: totalPrice.split('.')[1]}
this.paramData.allPrice = totalPrice
this.paramData.iNum = this.allPrice.iNum
this.paramData.fNum = this.allPrice.fNum
this.paramData.num = this.calNum()
this.$emit('changeParamData', this.paramData)
},
goCartOrder () {
if(this.cartData.every(v => !v.isSelected)){
uni.showToast({
title:'请先选中要购买的商品',
icon:'none',
})
return
}
let orderData = this.cartData.filter(v=>v.isSelected).map(v=>{
return {
goodsInfo: {
image: v.Specifications_image,
title:v.good_name,
merchant_name: v.merchant_name,
},
skuInfo: {
title:v.Specifications_name,
buyNum:v.num,
money: v.Specifications_money,
id: v.specifications_id,
},
}
})
let orderInfo = {
is_post: 1, //
goods: orderData,
post: 0
}
uni.setStorageSync('teChanOrder', JSON.stringify(orderInfo)); //
// uni.setStorageSync('teChanInfo', JSON.stringify(this.info)); //
uni.navigateTo({
url: '/subPackages/techan/order'
});
},
},
}
</script>
<style scoped lang="scss">
*{
box-sizing: border-box;
}
.bg{
width: 100%;
height: 100%;
}
.cart-container{
display: flex;
flex-direction: column;
background-color: white;
height: 933rpx;
padding-bottom: 184rpx;
border-radius: 20rpx 20rpx 0rpx 0rpx;
display: flex;
flex-direction: column;
position: absolute;
width: 100%;
bottom: 0;
z-index: 20;
.header-container{
display: flex;
align-items: center;
justify-content: space-between;
padding: 40rpx 26rpx;
.select-area{
font-family: PingFang SC;
font-weight: bold;
font-size: 37rpx;
color: #000000;
}
.delete-area{
font-family: PingFang SC;
font-weight: bold;
font-size: 27rpx;
color: #999999;
image{
width: 26rpx;
height: 26rpx;
}
}
}
}
.content-container{
flex: 1;
height: 10rpx;
overflow-y: auto;
padding:0 26rpx 26rpx;
.content-item{
margin-bottom: 48rpx;
}
.commodity {
display: flex;
.add-num-area{
display: flex;
justify-content: space-between;
align-items: center;
width: 160rpx;
image{
width: 49rpx;
height: 49rpx;
}
}
.goods-text-area{
display: flex;
flex-direction: column;
justify-content: space-between;
}
.commodity-price{
font-weight: 500;
font-size: 24rpx;
color: #F84A56;
display: flex;
align-items: baseline;
}
.commodity-info{
font-family: PingFangSC;
font-weight: 500;
font-size: 32rpx;
color: #2C2C2C;
}
// align-items: center;
.img {
width: 217rpx;
height: 179rpx;
border-radius: 13rpx;
flex-shrink: 0;
}
.title {
flex: 1;
margin-left: 20rpx;
font-size: 32rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
.price-list {
display: flex;
margin-top: 18rpx;
align-items: center;
.price-r {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
&:before {
content: '¥';
display: inline-block;
color: #fc5109;
font-size: 24rpx;
}
}
.price-g {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #b5bcc9;
text-decoration: line-through;
margin-left: 10rpx;
}
}
}
.num-box {
display: flex;
align-items: center;
margin-left: 20rpx;
width: 160rpx;
justify-content: space-between;
.num {
text-align: center;
width: 50rpx;
}
.ctrl {
width: 46rpx;
height: 46rpx;
}
}
}
}
.select-cycle{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
border: 1px solid #999999;
image{
width: 100%;
height: 100%;
}
}
.select-cycle.selected {
border: none;
image{
width: 40rpx;
height: 40rpx;
}
}
.ctrl {
width: 47rpx;
height: 47rpx;
background: #74A5AA;
border-radius: 50%;
font-family: PingFang SC;
font-weight: 400;
font-size: 34rpx;
color: #FFFFFF;
line-height: 47rpx;
text-align: center;
}
.ctrl.disabled{
background: #E8E8E8;
color: #999999;
}
</style>

265
components/contactAdd.vue

@ -0,0 +1,265 @@
<template>
<view class="bg">
<view class="list-forms">
<view class="list-item">
<view class="list-item-title">姓名</view>
<view class="list-item-input"><input type="text" v-model="username" placeholder="请输入姓名" /></view>
</view>
<view class="list-item">
<view class="list-item-title">证件类型</view>
<view class="list-item-input">
<picker mode="selector" :range="idcardTypeList" range-key="title" @change="changeIdType">
<input type="text" readonly style="font-size: 35rpx;position: relative;"
v-model="idcardTypeValue" disabled="true" placeholder="请选择"/>
</picker>
</view>
</view>
<view class="list-item">
<view class="list-item-title">证件号</view>
<view class="list-item-input"><input type="text" v-model="idNumber" placeholder="请输入正确的证件号" /></view>
</view>
<view class="list-item">
<view class="list-item-title">联系电话</view>
<view class="list-item-input"><input type="number" v-model="mobile" placeholder="请输入手机号" maxlength="11" /></view>
</view>
<view class="list-item">
<view class="list-item-title">设为默认</view>
<view class="list-item-switch">
<switch :checked="idDefault" @change="switchChange" color="#515150"/>
</view>
</view>
</view>
<!-- <view class="btn" @click="submit">保存</view> -->
</view>
</template>
<script>
export default {
data() {
return {
username: '',
mobile: '',
idNumber: '',
idcardTypeValue: '身份证',
show: false,
idcardTypeList: [],
document_type: 'DAM01001',
id: '',
type: '',
idDefault: false,
}
},
methods: {
init (data) {
this.username = ''
this.mobile= ''
this.idNumber= ''
this.idcardTypeValue= '身份证'
this.show= false
this.idcardTypeList= []
this.document_type= 'DAM01001'
this.id= ''
this.type=''
this.idDefault= false
this.type = 'add'
this.getIdcardTypeList()
if (data && data.id) {
this.id = data.id
this.type = 'edit'
this.getDetail()
}
},
switchChange(e){
this.idDefault = e.detail.value
},
getDetail() {
this.Post({
id: this.id
}, '/api/user/contactDetail').then(res => {
if (res.code === 1) {
res = res.data
if (res && res.id > 0) {
this.username = res.name
this.mobile = res.tel
this.idNumber = res.id_number
this.idDefault = res.is_default == 1 ? true : false
this.document_type = res.document_type
this.idcardTypeValue = res.document_type_text
}
}
})
},
//
getIdcardTypeList() {
this.Post({}, '/api/user/getIdcardTypeList').then(res => {
this.idcardTypeList = res.data
})
},
//
changeIdType(e) {
this.idcardTypeValue = this.idcardTypeList[e.detail.value].title
this.document_type = this.idcardTypeList[e.detail.value].document_type
},
//
async submit() {
this.username = this.username.trim()
this.mobile = this.mobile.trim()
this.idNumber = this.idNumber.trim()
if (this.username.length < 1) {
uni.showToast({
title: '请输入姓名',
icon: 'none'
})
return
}
if (!this.IsTel(this.mobile)) {
uni.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
return
}
if (this.idcardTypeValue == '身份证') {
if (!this.idCardNumber(this.idNumber)) {
uni.showToast({
title: '请输入正确的身份证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '护照') {
if (!this.passportValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的护照',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '台胞证') {
if (!this.taiwanValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的台胞证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '港澳通行证') {
if (!this.gangaoValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的港澳通行证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '外国人永久居留证') {
if (!this.foreignerValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的外国人永久居留证',
icon: 'none'
})
return
}
} else if (this.idcardTypeValue == '军官证') {
if (!this.officerValid(this.idNumber)) {
uni.showToast({
title: '请输入正确的军官证',
icon: 'none'
})
return
}
}
let res = await this.Post({
id: this.type == 'edit'?this.id:'',
id_number: this.idNumber,
name: this.username,
tel: this.mobile,
document_type: this.document_type,
is_default: this.idDefault ? '1' : '0',
}, this.type=='edit'?'/api/user/editContact':'/api/user/addContact')
if (res.code == 1) {
uni.showModal({
title: '提示',
content: '操作成功',
showCancel: false,
})
}else{
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
})
}
return {...res,data: {id: this.id}}
}
}
}
</script>
<style scoped lang="scss">
.bg {
width: 100%;
height: 100%;
position: relative;
}
.list-forms {
padding: 0 33rpx;
.list-item {
display: flex;
border-bottom: 1rpx solid #D8D8D8;
padding: 30rpx 0;
height: 60rpx;
box-sizing: content-box;
align-items: center;
.list-item-title {
font-size: 34rpx;
margin-right: 20rpx;
width: 200rpx;
}
.list-item-input {
flex: 1;
input {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
border: 0;
background-color: transparent;
line-height: 34rpx;
font-size: 34rpx;
text-align: left;
}
input::placeholder {
font-size: 26rpx;
}
}
}
}
.btn {
width: 697rpx;
height: 80rpx;
background: #515150;
border-radius: 40rpx;
text-align: center;
line-height: 80rpx;
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FFFFFF;
position: absolute;
bottom: 53rpx;
left: 27rpx;
}
</style>

11
package-lock.json

@ -0,0 +1,11 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"ydui-district": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/ydui-district/-/ydui-district-1.1.0.tgz",
"integrity": "sha512-MBhvfaR5Gkn6MUmEnrH1A7IFB5igALuDgtIF+gz3dRwNwW9+KOmih7z+xZFfGluMsEbWaT7C3lWOckYsLZQnFg=="
}
}
}

19
package.json

@ -0,0 +1,19 @@
{
"name": "cgc_wechat",
"version": "1.0.0",
"description": "",
"main": "main.js",
"dependencies": {
"ydui-district": "^1.1.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "http://123.60.98.226:3000/chenkainan/cgc_WeChat.git"
},
"author": "",
"license": "ISC"
}

19
pages.json

@ -21,6 +21,25 @@
"style": { "style": {
"navigationBarTitleText": "uni-app" "navigationBarTitleText": "uni-app"
} }
},
{
"path": "techan/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom"
}
},
{
"path": "techan/detail",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "techan/order",
"style": {
"navigationBarTitleText": "确认订单"
}
} }
] ]
}], }],

36
static/css/base.css

@ -69,3 +69,39 @@ view {
color: #999999; color: #999999;
} }
.flex{
display: flex;
}
.flex-shrink-0{
flex-shrink: 0;
}
.flex-1{
flex: 1;
}
.flex-wrap{
flex-wrap: wrap;
}
.w-full{
width: 100%;
}
.w-1rpx{
width: 1rpx;
}
.h-1rpx{
height: 1rpx;
}
.relative{
position: relative;
}
.absolute{
position: absolute;
}
.flex-items-center{
align-items: center;
}
.no-scrollbar::-webkit-scrollbar{
display: none;
}
.font-bold{
font-weight: bold;
}

30
static/js/CommonFunction.js

@ -90,7 +90,7 @@ Vue.prototype.showImg = img => {
if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) { if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) {
return img; return img;
} else { } else {
return this.NEWAPIURL + img; return Vue.prototype.NEWAPIURL + img;
} }
} }
@ -223,3 +223,31 @@ Vue.prototype.getHeadImg = type => {
return res.data[0].image return res.data[0].image
}); });
} }
// 判断是否去外部链接
Vue.prototype.goOtherDetail = (item,type) => {
if(item.link_type == 1) {
// 外部小程序
uni.navigateToMiniProgram({
shortLink: item.ext_link
})
return true
}else if(item.link_type == 2){
// 外部H5
uni.navigateTo({
url: '/subPackages/webPage/webPage?url=' + item.ext_link
});
return true
}
}
// 根据类型判断详情页
Vue.prototype.goDetailByType= function(item){
let res = this.goOtherDetail(item)
if (res) {
return
}
uni.navigateTo({
url: `/subPackages/techan/detail?id=?${item.id}`
})
}

129
static/js/request.js

@ -1,77 +1,58 @@
import Vue from 'vue'; import Vue from 'vue'
import store from '@/store'; import store from '@/store'
// 定义 API URL let NEWAPIURL = 'https://tlgz.sz-trip.com'
const DEV_API_URL = 'https://api.cloud.sz-trip.com'; Vue.prototype.NEWAPIURL = NEWAPIURL
const PROD_API_URL = 'https://api.cloud.sz-trip.com';
const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL;
// 获取token Vue.prototype.Post = (params, apiurl) => {
const getToken = () => { if (uni.getStorageSync('userInfo') && JSON.parse(uni.getStorageSync('userInfo')).token) params.token = JSON.parse(uni.getStorageSync('userInfo')).token
const userInfoFromStorage = uni.getStorageSync('userInfo'); else if (store.state.user.userInfo.token) params.token = store.state.user.userInfo.token
if (userInfoFromStorage) { params.token = "aa3940ea-57f5-412e-9803-4035d5115994"
const userInfo = JSON.parse(userInfoFromStorage); return new Promise((resolve, reject) => {
if (userInfo.token) { uni.showLoading({
return userInfo.token; title: '加载中'
} })
} uni.request({
return store.state.user.userInfo.token; method: params.method || 'GET',
}; url: NEWAPIURL + apiurl,
data: params || {},
// 定义错误处理函数 header: params.header || {
const handleError = (res, reject) => { 'content-type': 'application/json',
setTimeout(() => { 'token': params.token || ''
uni.showToast({ },
title: res.data?.msg || res.msg, success: res => {
icon: 'none' uni.hideLoading()
}); if (res.data.code === 1) {
reject(res); resolve(res.data)
}, 0); } else {
if (res.data?.code === 401) { setTimeout(() => {
store.commit('changeLoginPath'); uni.showToast({
} title: res.data.msg,
}; icon: 'none'
})
// 挂载到 Vue 原型上 reject(null)
Vue.prototype.NEWAPIURL = NEWAPIURL; }, 0)
// #ifdef H5 if (res.data.code === 401) {
Vue.prototype.NEWAPIURL = '/api'; store.commit('changeLoginPath')
// #endif }
}
Vue.prototype.Post = (params = {}, apiurl) => { },
const token = getToken(); fail: err => {
if (token) { console.log('err', err)
params.token = token; uni.hideLoading()
} setTimeout(() => {
return new Promise((resolve, reject) => { uni.showToast({
uni.showLoading({ title: err.msg || err.data.msg,
title: '加载中' icon: 'none'
}); })
uni.request({ }, 0)
method: params.method || 'GET', if (err.data.code === 401) {
url: Vue.prototype.NEWAPIURL + apiurl, store.commit('changeLoginPath')
data: params, }
header: { reject(err)
'content-type': 'application/json', }
'token': token || '' })
}, })
success: (res) => { }
console.log('success', res.data);
uni.hideLoading()
if (res.data.code === 200 || res.data.code === 1) {
resolve(res.data);
} else {
handleError(res, reject);
}
},
fail: (err) => {
console.log('err', err);
uni.hideLoading()
handleError(err, reject);
}
});
});
};
export default NEWAPIURL;
export default NEWAPIURL

507
subPackages/techan/detail.vue

@ -20,86 +20,77 @@
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- <view class="swiper-item-num">{{ info.list_images.split(',').length }}</view> --> <view class="swiper-item-num">{{ info.list_images.split(',').length }}</view>
</view> </view>
<view class="w-full relative" style="padding: 26rpx;top: -52rpx;"> <view class="w-full relative" style="padding: 26rpx 0;top: -52rpx;">
<view class="price-box "> <view class="price-box ">
<view class="price-zan"> <view class="price-zan">
<view class="price"> <view class="price">
<view class="present-price">{{ info.money / 100 }}</view> <view class="present-price">{{ info.money / 100 }}</view>
</view> </view>
</view> </view>
<view class="title text-overflowRows">{{ info.title }}</view>
<view class="tag no-scrollbar" v-if="info.goods_new_tag"> <view class="tag no-scrollbar" v-if="info.goods_new_tag">
<view class="tag-item" v-for="(item, index) in info.goods_new_tag.split(',')" :key="index"> <view class="tag-item" v-for="(item, index) in info.goods_new_tag.split(',')" :key="index">
{{ item }} {{ item }}
</view> </view>
</view> </view>
<view class="title">{{ info.title }}</view>
</view> </view>
<view class="sp-box" @click="openPop">
<view class="sp-box-left flex-1"> <view class="sku-box" v-if="sku.length>0">
<view class="flex-shrink-0"> <view class="sku-item" v-for="(item,i) in sku" :key="i">
选择 <image :src="showImg(item.image)"></image>
</view> <view class="sku-content">
<view class="flex-1"> <view class="flex-1">{{item.title}}</view>
{{sku[productIndex].title || '暂无可选规格'}} <view class="present-price">{{item.money/100}}</view>
</view> </view>
</view> </view>
<uni-icons class="flex-shrink-0" style="height: 36rpx;margin-right: 20rpx;" type="right" size="18"></uni-icons>
</view> </view>
<view class="pro-title">产品简介</view>
<view class="notice" > <view class="notice" >
<view class="title">购买须知</view>
<view class="rich-text" v-html="formateRichText(info.special_content)"></view>
</view>
<view class="notice" >
<view class="title">商品须知</view>
<view class="rich-text" v-html="formateRichText(info.special_content)"></view> <view class="rich-text" v-html="formateRichText(info.special_content)"></view>
</view> </view>
<!-- <template v-if="id">
<userReviewsVue :goodsId="id" ></userReviewsVue>
<moreGoodsVue :goodsId="id"></moreGoodsVue>
</template> -->
</view> </view>
<template v-if="!popShow">
<view class="btn-list" v-if="!paramData.showCart"> <view class="btn-list" v-if="!paramData.showCart">
<view class="left-box"> <view class="left-box">
<view class="img-box" slot="content" v-if="is_post==1"> <view class="img-box" slot="content">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small" <uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#F7F7F7',color:'#F84A56',border:'1px solid #F84A56'}"> :custom-style="{background:'#D90F01',color:'#ffffff',border:'1px solid #ffffff'}">
<image @click.stop="showCartClick" :src="showImg('/uploads/20241104/88b88bf627a63dd000afe769d1392fb4.png')" mode="aspectFill" <image @click.stop="showCartClick" :src="showImg('/uploads/20241104/88b88bf627a63dd000afe769d1392fb4.png')" mode="aspectFill"
style="width: 78rpx;height: 78rpx;"></image> style="width: 60rpx;height: 50rpx;"></image>
</uni-badge> </uni-badge>
<text class="text">购物车</text>
</view> </view>
<button id="contact" open-type="contact" bindcontact="handleContact" session-from="sessionFrom">
<view class="img-box">
<image :src="showImg('/uploads/20241023/c5686c6abd8ff8370ca65e0d129566cf.png')"
mode="aspectFill"></image>
<view class="text">
客服
</view>
</view>
</button>
</view> </view>
<view class="btn-post" v-if="is_post==1"> <view class="btn-post">
<view class="left-btn-buy" @click="openPop(true)">加入购物车</view> <view class="left-btn-buy" @click="openPop(true)">加入购物车</view>
<view class="right-btn-buy" @click="openPop(false)">立即购买</view> <view class="right-btn-buy" @click="openPop(false)">立即购买</view>
</view> </view>
<view v-else class="btn-buy" @click="openPop(false)">
立即购买
</view>
</view> </view>
<view class="btn-list" v-else> <view class="btn-list" v-else>
<view class="left-box"> <view class="left-box">
<view class="img-box" slot="content"> <view class="img-box" slot="content">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small" <uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#F7F7F7',color:'#F84A56',border:'1px solid #F84A56'}"> :custom-style="{background:'#D90F01',color:'#ffffff',border:'1px solid #ffffff'}">
<image @click.stop="showCartClick" :src="showImg('/uploads/20241104/88b88bf627a63dd000afe769d1392fb4.png')" mode="aspectFill" <image @click.stop="showCartClick" :src="showImg('/uploads/20241104/88b88bf627a63dd000afe769d1392fb4.png')" mode="aspectFill"
style="width: 78rpx;height: 78rpx;"></image> style="width: 60rpx;height: 50rpx;"></image>
</uni-badge> </uni-badge>
<text class="text">购物车</text>
</view> </view>
<view class="bottom-price"> <view class="bottom-price">
<text style="color: #000000;">总计</text>
<view class="bottom-price-yuan">{{paramData.iNum}}</view> <view class="bottom-price-yuan">{{paramData.iNum}}</view>
<view>.{{paramData.fNum}}</view> <view>.{{paramData.fNum}}</view>
@ -108,13 +99,15 @@
</view> </view>
<view class="btn-buy" @click="goCartOrder"> <view class="btn-buy" @click="goCartOrder">
提交订单 去结算
</view> </view>
</view> </view>
</template>
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" :key="new Date().getTime()"></cartDataVue> <cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" :key="new Date().getTime()"></cartDataVue>
<uni-popup ref="popup" type="bottom" @change="changPopShow" style="position: relative;z-index: 50;"> <uni-popup ref="popup" type="bottom" @change="changPopShow"
:safe-area="false" style="position: relative;z-index: 50;">
<view class="popup-content" v-if="sku.length>0"> <view class="popup-content" v-if="sku.length>0">
<view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;"> <view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;">
<uni-icons type="closeempty" size="24"></uni-icons> <uni-icons type="closeempty" size="24"></uni-icons>
@ -140,7 +133,7 @@
<view class="noStore-text" v-if="botItem.store==0"> <view class="noStore-text" v-if="botItem.store==0">
不可购买 不可购买
</view> </view>
<view class="noStore-text" v-else-if="is_post==1&&botItem.is_post!=1">不可加购</view> <!-- <view class="noStore-text" v-else-if="is_post==1&&botItem.is_post!=1">不可加购</view> -->
</view> </view>
</view> </view>
@ -158,22 +151,20 @@
</view> </view>
</view> </view>
</view> </view>
<view style="height: 100rpx;"></view> <!-- <view style="height: 100rpx;"></view> -->
<!-- <view class="btn-box"> <view class="btn-box">
<view class="buy-btn" @click="order"> <view class="buy-btn" @click="openPop(addCartOrOrder)">
下一步 {{addCartOrOrder?'加入购物车':'立即购买'}}
</view> </view>
</view> --> </view>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import userReviewsVue from '../../compoents/userReviews.vue'; import cartDataVue from '../../components/cartData.vue'
import moreGoodsVue from '../../compoents/moreGoods.vue'
import cartDataVue from '../../compoents/cartData.vue'
export default { export default {
components: {cartDataVue,userReviewsVue,moreGoodsVue}, components: {cartDataVue},
data() { data() {
return { return {
id: null, id: null,
@ -181,13 +172,14 @@
sku: [], sku: [],
productIndex: 0, productIndex: 0,
is_post: "2", is_post: "1",
isCollect: false, isCollect: false,
showLength: 0, showLength: 0,
buyNum: 1, buyNum: 1,
popShow: false, popShow: false,
paramData: {allPrice: 0,iNum:0, fNum:'00', showCart: false, num: 0}, paramData: {allPrice: 0,iNum:0, fNum:'00', showCart: false, num: 0},
addCartOrOrder: null, //true false
}; };
}, },
onLoad(option) { onLoad(option) {
@ -220,18 +212,13 @@
}, 2000) }, 2000)
} }
this.info = res.data; this.info = res.data;
this.isCollect = this.info.is_collect; // this.isCollect = this.info.is_collect;
if (this.info.title) {
let param = { uni.setNavigationBarTitle({
sku_id: this.info.id, title: this.info.title
sku_name: this.info.title, })
sku_price: this.info.price/100,
category_id: this.info.type_id,
category_name:this.info.type_name,
visitSource: this.getVisitSource()
} }
this.qdTracker('viewProductDetail', param)
}); });
}, },
getSpecificationsByGoodsId() { getSpecificationsByGoodsId() {
@ -243,11 +230,11 @@
if (res) { if (res) {
this.sku = res.data || []; this.sku = res.data || [];
// todo // todo
this.is_post = "2" // this.is_post = "2"
if (this.sku.length>0 && this.sku.some(v=>v.is_post == 1)) { // if (this.sku.length>0 && this.sku.some(v=>v.is_post == 1)) {
this.is_post = "1" // this.is_post = "1"
} // }
} }
}); });
}, },
@ -295,6 +282,7 @@
if (!this.popShow) { if (!this.popShow) {
this.$refs.popup.open() this.$refs.popup.open()
this.addCartOrOrder = flag
} else { } else {
if (flag) { if (flag) {
this.addToCart() this.addToCart()
@ -309,8 +297,8 @@
goods.buyNum = this.buyNum goods.buyNum = this.buyNum
let orderInfo = { let orderInfo = {
is_post: goods.is_post || "1", // is_post: goods.is_post || "2",
// is_post: 2, is_post: 1,
goods: [{goodsInfo: this.info, skuInfo: goods }], goods: [{goodsInfo: this.info, skuInfo: goods }],
post: 0, post: 0,
} }
@ -323,13 +311,6 @@
}, },
addToCart () { addToCart () {
let goods = this.sku[this.productIndex] let goods = this.sku[this.productIndex]
if(goods.is_post!=1) {
uni.showToast({
title: '此规格不支持加入购物车',
icon: 'none'
})
return
}
goods.buyNum = this.buyNum goods.buyNum = this.buyNum
let goodsInfo = {goodsInfo:this.info, skuInfo: goods, isSelected: true} let goodsInfo = {goodsInfo:this.info, skuInfo: goods, isSelected: true}
@ -404,22 +385,8 @@
view { view {
box-sizing: border-box; box-sizing: border-box;
} }
button {
margin: 0;
padding: 0;
outline: none;
border-radius: 0;
background-color: transparent;
line-height: inherit;
}
button::after {
border: none;
}
.swipe-box { .swipe-box {
height: 400rpx; height: 750rpx;
position: relative; position: relative;
.swiper-item-num { .swiper-item-num {
@ -440,31 +407,20 @@
} }
.swiper { .swiper {
height: 400rpx; height: 750rpx;
position: relative; position: relative;
.swiper-item { .swiper-item {
width: 100%; width: 100%;
height: 400rpx; height: 750rpx;
.item-img { .item-img {
width: 750rpx; width: 750rpx;
height: 400rpx; height: 750rpx;
} }
} }
} }
.common-container{
width: 100%;
padding: 32rpx;
}
.pro-title{
font-weight: bold;
font-size: 37rpx;
color: #000000;
margin: 66rpx 0 19rpx 0;
}
.price-box { .price-box {
width: 100%; width: 100%;
@ -479,27 +435,6 @@
.price { .price {
display: flex; display: flex;
.present-price {
font-size: 42rpx;
font-family: PingFang SC;
font-weight: bold;
color: #C3282E;
&:before {
content: '¥';
display: inline-block;
font-size: 26rpx;
}
&:after {
content: '起';
display: inline-block;
font-size: 24rpx;
font-family: PingFangSC;
color: #8D8D8D;
}
}
} }
} }
@ -511,136 +446,59 @@
overflow-x: auto; overflow-x: auto;
.tag-item { .tag-item {
margin-right: 14rpx; margin-right: 10rpx;
font-family: PingFangSC; padding: 0rpx 15rpx;
padding: 8rpx 16rpx;
flex-shrink: 0; flex-shrink: 0;
border:1px solid #515150;
border-radius: 11rpx;
font-weight: 500; font-weight: 500;
font-size: 24rpx; font-size: 23rpx;
color: #515150; color: #60989E;
height: 37rpx;
line-height: 37rpx;
background: rgba(96, 152, 158, 0.2);
border-radius: 4rpx;
} }
} }
.title { .title {
margin-top: 20rpx; margin-top: 22rpx;
font-family: PingFang; font-family: PingFang;
font-weight: bold; font-weight: bold;
font-size: 31rpx; font-size: 31rpx;
color: #000000; color: #000000;
} }
} }
.present-price {
font-size: 42rpx;
font-family: PingFang SC;
font-weight: 500;
color: #FC5109;
.notice { &:before {
padding: 35rpx; content: '¥';
width: 100%; display: inline-block;
background: #ffffff; font-size: 26rpx;
border-radius: 20rpx;
}
.tab {
width: 750rpx;
height: 88rpx;
background: #ffffff;
box-shadow: 0px 1rpx 0px 0px rgba(227, 229, 232, 1);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 32rpx;
position: fixed;
top: 0;
.tab-item {
height: 88rpx;
position: relative;
line-height: 88rpx;
.tab-text {
font-size: 30rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #393b3e;
}
.act-text {
font-size: 30rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #000000;
}
.tab-line {
width: 60rpx;
height: 6rpx;
background: #08c59b;
border-radius: 3rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translate(-30rpx, 0);
}
}
}
.more {
width: 100%;
height: 93rpx;
line-height: 93rpx;
text-align: center;
border-top: solid 1rpx rgba(227, 229, 232, 1);
font-size: 26rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #4D526C;
margin-top: 50rpx;
}
.xzPopup {
width: 750rpx;
padding: 33rpx 26rpx 20rpx;
box-sizing: border-box;
background-color: #FFFFFF;
position: relative;
max-height: 70vh;
overflow-y: auto;
view {
padding: 0 20rpx;
box-sizing: border-box;
margin-top: 35rpx;
} }
img { &:after {
width: 32rpx; content: '起';
height: 32rpx; display: inline-block;
position: absolute; font-size: 24rpx;
top: 33rpx; font-family: PingFangSC;
right: 27rpx; color: #B5BCC9;
} }
} }
.comment { .notice {
display: flex; width: 700rpx;
align-items: center; margin: 25rpx auto 0;
justify-content: space-between; background: #ffffff;
box-sizing: border-box; border-radius: 20rpx;
width: 710rpx; padding: 40rpx 25rpx;
height: 100rpx; .title{
background: #FFFFFF;
border-radius: 13rpx;
margin: 0 auto;
margin-top: 20rpx;
padding: 0 20rpx;
.comment-left {
display: flex;
align-items: center;
font-size: 36rpx;
font-family: PingFangSC;
font-weight: bold; font-weight: bold;
font-size: 36rpx;
color: #000000; color: #000000;
margin-bottom: 30rpx;
} }
} }
@ -654,7 +512,7 @@
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1); box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6, 0, 1, 0.1);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 30rpx 50rpx 0 50rpx; padding: 30rpx 25rpx 0 50rpx;
.left-box { .left-box {
display: flex; display: flex;
@ -666,7 +524,7 @@
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
font-size: 27rpx; font-size: 27rpx;
color: #F84A56; color: #D70000;
padding-top: 20rpx; padding-top: 20rpx;
.bottom-price-yuan{ .bottom-price-yuan{
font-size: 40rpx; font-size: 40rpx;
@ -684,7 +542,7 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-right: 64rpx; margin-right: 50rpx;
image { image {
width: 48rpx; width: 48rpx;
@ -692,19 +550,18 @@
} }
.text { .text {
font-size: 24rpx; font-weight: 500;
font-family: PingFangSC; font-size: 22rpx;
font-weight: 400; color: #4D526C;
color: #666666;
} }
} }
} }
.btn-buy { .btn-buy {
width: 293rpx; width: 240rpx;
height: 78rpx; height: 78rpx;
background: #C3282E; background: #74A5AA;
border-radius: 40rpx; border-radius: 40rpx;
text-align: center; text-align: center;
line-height: 78rpx; line-height: 78rpx;
@ -720,47 +577,43 @@
padding: 0rpx 39rpx 51rpx 39rpx; padding: 0rpx 39rpx 51rpx 39rpx;
height: auto; height: auto;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
}
.bottom-productImg {
display: flex;
margin-bottom: 23rpx;
}
.bottom-productImg img {
width: 218rpx;
height: 179rpx;
background: #666666;
border-radius: 13rpx;
}
.right-content {
margin: 10rpx 0 0 41rpx;
}
.bottom-productPrice {
font-size: 40rpx;
color: #FC524B;
&:before { .bottom-productImg {
content: "¥"; display: flex;
font-size: 26rpx; margin-bottom: 23rpx;
img {
width: 218rpx;
height: 179rpx;
background: #666666;
border-radius: 13rpx;
}
} }
} .right-content {
margin: 10rpx 0 0 41rpx;
}
.bottom-productPrice {
font-size: 40rpx;
color: #FC524B;
.bottom-content { &:before {
width: 331rpx; content: "¥";
font-size: 27rpx; font-size: 26rpx;
font-family: PingFang SC; }
font-weight: 400; }
color: #666666; .bottom-content {
width: 331rpx;
font-size: 27rpx;
font-family: PingFang SC;
font-weight: 400;
color: #666666;
}
} }
.botProduct { .botProduct {
width: 320rpx; width: 320rpx;
// height: 78rpx; // height: 78rpx;
border-radius: 13rpx; border-radius: 13rpx;
background-color: #F5F5F5; background-color: #EFEFEF;
font-size: 29rpx; font-size: 29rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
@ -796,7 +649,7 @@
.botProducts { .botProducts {
// border: 1rpx solid #00AAFF; // border: 1rpx solid #00AAFF;
// background-color: rgba(254, 180, 25, 1); // background-color: rgba(254, 180, 25, 1);
background: #515150; background: #74A5AA;
color: #FFFFFF; color: #FFFFFF;
} }
@ -810,11 +663,11 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.number-btn {
display: flex;
}
} }
.buy-num .number-btn {
display: flex;
}
.buy-num .number-btn view { .buy-num .number-btn view {
display: flex; display: flex;
@ -835,7 +688,7 @@
height: 78rpx; height: 78rpx;
text-align: center; text-align: center;
line-height: 78rpx; line-height: 78rpx;
background: linear-gradient(90deg, #F84A56, #FF9834); background: #74A5AA;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 34rpx; font-size: 34rpx;
@ -866,66 +719,72 @@
margin: 60rpx 0; margin: 60rpx 0;
padding-top: 30rpx; padding-top: 30rpx;
} }
.sp-box {
width: 100%;
background: #fff;
display: flex;
align-items: center;
justify-content: space-between;
border-radius: 0 0 12rpx 12rpx;
padding: 10rpx 0 30rpx;
.sp-box-left {
display: flex;
margin-left: 38rpx;
align-items: center;
:first-child {
font-family: PingFang;
font-weight: 500;
font-size: 31rpx;
color: #999999;
}
:last-child {
width: 403rpx;
font-family: PingFang SC;
font-weight: 400;
font-size: 31rpx;
color: #000000;
}
}
image {
width: 16rpx;
height: 28rpx;
margin-right: 38rpx;
}
}
.btn-post{ .btn-post{
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 500; font-weight: 500;
color: #FFFFFF; font-size: 32rpx;
color: #60989E;
line-height: 77rpx; line-height: 77rpx;
text-align: center; text-align: center;
display: flex; display: flex;
.left-btn-buy{ .left-btn-buy{
width: 207rpx; width: 186rpx;
height: 77rpx; height: 77rpx;
color: #C3282E; color: #60989E;
border-radius: 39rpx 0rpx 0rpx 39rpx; border-radius: 39rpx 0rpx 0rpx 39rpx;
border: 1px solid #C3282E; background: rgba(116, 165, 170, 0.3);
} }
.right-btn-buy{ .right-btn-buy{
width: 207rpx; width: 187rpx;
height: 77rpx; height: 77rpx;
background: #C3282E; background: #74A5AA;
border-radius: 0rpx 39rpx 39rpx 0rpx; border-radius: 0rpx 39rpx 39rpx 0rpx;
color: white;
}
}
.sku-box{
width: 700rpx;
margin: 25rpx auto 0;
background: #FFFFFF;
border-radius: 20rpx;
.sku-item{
border-radius: 20rpx;
width: 100%;
padding: 14rpx;
display: flex;
border-bottom: 1px solid #D8D8D8;
.sku-content{
display: flex;
padding-left: 16rpx;
flex: 1;
width: 1rpx;
}
image{
width: 160rpx;
height: 160rpx;
border-radius: 13rpx;
flex-shrink: 0;
}
.flex-1{
font-weight: 500;
font-size: 29rpx;
color: #000000;
height: 160rpx;
padding-right: 75rpx;
overflow: hidden;
}
.present-price{
display: flex;
align-items: center;
}
.present-price::after{
content: '';
}
}
.sku-item:last-of-type{
border: none;
} }
} }

456
subPackages/techan/techanList.vue → subPackages/techan/index.vue

@ -1,79 +1,82 @@
<template> <template>
<view class="bg"> <view class="bg">
<span class="iconfont topLeft" @click="goBack">&#xe660;</span> <view class="search-header" :style="{'height': height+'px','padding-top':statusBarHeight+'px'}">
<img :src="showImg(headImg)" class="topImg" /> <uni-icons type="left" size="20" @click="goBack" style="flex-shrink: 0;"></uni-icons>
<view class="type-container"> <view class="input-model">
<view class="send-type-container"> <uni-icons style="height: 1.4rem;line-height: 1.4rem;" type="search" size="15" color="#ABAAAD" ></uni-icons>
<view :class="['type',type1==0?'active':'']" @click.stop="changeType('type1',0)"> <input class="input-text" placeholder="请输入商品名称" v-model="searchText"></text>
<image :src="showImg(type1==0?'/uploads/20241023/0d46c6d4ba08c7eb428770d27abf90aa.png':'/uploads/20241104/0da5535494f95dc1bd1b125f2ea14bca.png')"></image>
自提专区
</view>
<view :class="['type',type1==1?'active':'']" @click.stop="changeType('type1',1)">
<image :src="showImg(type1==1?'/uploads/20241023/fbc0d085d012bdad49d865c5aa85f4a9.png':'/uploads/20241104/1cd8c1aaf2d4ded7a3ead6f0396e100d.png')"></image>
邮寄专区
</view>
</view>
<view class="goods-type-container">
<view :class="['type',type2==0?'active':'']" @click.stop="changeType('type2',0)">特产</view>
<view :class="['type',type2==1?'active':'']" @click.stop="changeType('type2',1)">文创</view>
</view> </view>
</view> </view>
<view class="box"> <div :style="{'height':height+'px'}"></div>
<view class="item" v-for="item in list" :key="item.goods.id" @click="viewDetail(item.goods)">
<image class="item-img" :src="showImg(item.goods.image)" mode=""></image>
<view class="content"> <img :src="showImg(headImg)" class="topImg" />
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="bottom"> <view class="goods-container">
<view class="price"> <scroll-view class="left-container no-scrollbar" :scroll-y="true">
{{item.goods.money/100}} <view :class="['type-item',typeIndex==i?'active':'']"
</view> v-for="(item,i) in typeParam" :key="i">
<view class="buy" v-show="type1==0"> | WEI
立即购买 <view class="active-type-bar" v-if="typeIndex==i"></view>
</view> </view>
<view class="buy-cart" v-show="type1==1" @click.stop="showOrderCart(item.goods)"> <view style="height: 148rpx;width: 1rpx;"></view>
<image :src="showImg('/uploads/20241104/0ac7eb782b73e60e3cfc8200b7934a4a.png')"></image> </scroll-view>
<scroll-view class="right-container no-scrollbar" :scroll-y="true">
<view class="item" v-for="item in list" :key="item.goods.id" @click="viewDetail(item.goods)">
<image class="item-img" :src="showImg(item.goods.image)" mode=""></image>
<view class="content">
<view class="title text-overflowRows">{{item.goods.title}}</view>
<view class="bottom">
<view class="price">
{{item.goods.money/100}}
</view>
<view class="buy-cart" @click.stop="showOrderCart(item.goods)">
<image :src="showImg('/uploads/20241104/0ac7eb782b73e60e3cfc8200b7934a4a.png')"></image>
</view>
</view> </view>
</view> </view>
</view> </view>
</view>
<view style="height: 148rpx;width: 1rpx;"></view>
</scroll-view>
</view> </view>
<view style="height: 148rpx;width: 1rpx;" v-if="type1==1"></view> <!-- 购物车 -->
<view class="btn-bottom" v-if="type1==1"> <view class="btn-bottom" >
<cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" style="width: 100%;height: 100%;"> <cartDataVue ref="cartDataVueRef" :paramData="paramData" @changeParamData="changeParamData" style="width: 100%;height: 100%;">
<template class="btn-list" slot="content"> <template class="btn-list" slot="content">
<view class="left-box"> <view class="left-box">
<uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small" <uni-badge class="uni-badge-left-margin" :text="paramData.num" absolute="rightTop" :offset="[5, 5]" size="small"
:custom-style="{background:'#F7F7F7',color:'#C3282E',border:'1px solid #C3282E'}"> :custom-style="{background:'#D90F01',color:'#ffffff',border:'1px solid #ffffff'}">
<view class="img-box" @click.stop="showCartClick"> <view class="img-box" @click.stop="showCartClick">
<image :src="showImg('/uploads/20241104/88b88bf627a63dd000afe769d1392fb4.png')" mode="aspectFill"></image> <image :src="showImg('/uploads/20241104/88b88bf627a63dd000afe769d1392fb4.png')" mode="aspectFill"></image>
</view> </view>
</uni-badge> </uni-badge>
<view class="bottom-price"> <view class="bottom-price">
<text style="color: #000000;">总计</text>
<view class="bottom-price-yuan">{{paramData.iNum}}</view> <view class="bottom-price-yuan">{{paramData.iNum}}</view>
<view>.{{paramData.fNum}}</view> <view>.{{paramData.fNum}}</view>
</view> </view>
<view class="bottom-detail-icon" @click.stop="showCartClick"> <view class="bottom-detail-icon" @click.stop="showCartClick">
明细 明细
<view v-if="!paramData.showCart" style="transform: rotate(-90deg);"><uni-icons color="#000" type="left" size="15"></uni-icons></view> <view v-if="!paramData.showCart" style="transform: rotate(-90deg);"><uni-icons color="#0B898E" type="left" size="15"></uni-icons></view>
<view v-else style="transform: rotate(90deg);"><uni-icons color="#000" type="left" size="15"></uni-icons></view> <view v-else style="transform: rotate(90deg);"><uni-icons color="#0B898E" type="left" size="15"></uni-icons></view>
</view> </view>
</view> </view>
<view class="btn-buy" @click="goCartOrder"> <view class="btn-buy" @click="goCartOrder">
提交订单 去结算
</view> </view>
</template> </template>
</cartDataVue> </cartDataVue>
</view> </view>
<uni-popup ref="popup" type="bottom" :safe-area="true"> <uni-popup ref="popup" type="bottom" :safe-area="true">
<view class="popup-content" v-if="sku.length>0"> <view class="popup-content" v-if="sku.length>0">
<view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;"> <view @click="closePopup" style="padding: 31rpx 0 0 639rpx;width: 50rpx;height: 80rpx;">
@ -88,9 +91,6 @@
</view> </view>
</view> </view>
<view> <view>
<view class="sp">
规格
</view>
<view style="display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;"> <view style="display: flex;align-items: center;justify-content: space-between;flex-wrap: wrap;">
<view style="position:relative;" v-for="(botItem,botIndex) in sku" :key="botIndex"> <view style="position:relative;" v-for="(botItem,botIndex) in sku" :key="botIndex">
<view :class="['botProduct','text-overflow',{'noStore':botItem.store==0},{'botProducts':productIndex==botIndex}]" <view :class="['botProduct','text-overflow',{'noStore':botItem.store==0},{'botProducts':productIndex==botIndex}]"
@ -100,9 +100,8 @@
<view class="noStore-text" v-if="botItem.store==0"> <view class="noStore-text" v-if="botItem.store==0">
不可购买 不可购买
</view> </view>
<view class="noStore-text" v-else-if="botItem.is_post!=1">不可加购</view> <!-- <view class="noStore-text" v-else-if="botItem.is_post!=1">不可加购</view> -->
</view> </view>
</view> </view>
</view> </view>
<view class="buy-num com-flex-tao"> <view class="buy-num com-flex-tao">
@ -124,33 +123,29 @@
<view class="btn" @click.stop="order">加入购物车</view> <view class="btn" @click.stop="order">加入购物车</view>
</view> </view>
</view> </view>
<!-- <view class="btn-box">
<view class="buy-btn" @click="order">
下一步
</view>
</view> -->
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
<script> <script>
import cartDataVue from '../../compoents/cartData.vue' import cartDataVue from '../../components/cartData.vue'
export default { export default {
components: {cartDataVue}, components: {cartDataVue},
data() { data() {
return { return {
//
height: 0,
statusBarHeight: 0,
headImg: null, headImg: null,
type1:0, typeParam: [
type2:0, {id: 1, title: ''},{id: 1, title: ''},{id: 1, title: ''},
typeParam: { {id: 1, title: ''},{id: 1, title: ''},{id: 1, title: ''},
'00':57, // - {id: 1, title: ''},{id: 1, title: ''},{id: 1, title: ''},
'01':58, // - {id: 1, title: ''},{id: 1, title: ''},{id: 1, title: ''},
'10':59, // - {id: 1, title: ''},{id: 1, title: ''},{id: 1, title: ''},
'11':60, // - ],
}, typeIndex: 0,
list:[], list:[],
finished: false, finished: false,
@ -161,7 +156,10 @@
sku: [], sku: [],
productIndex: 0, productIndex: 0,
buyNum: 1, buyNum: 1,
cartDataVueShow: false cartDataVueShow: false,
searchText: '',
searchList: []
} }
}, },
onLoad(options) { onLoad(options) {
@ -169,9 +167,17 @@
}, },
onReady() { onReady() {
this.initRectInfo()
this.getList() this.getList()
}, },
methods: { methods: {
initRectInfo () {
const sysInfo = uni.getSystemInfoSync()
this.statusBarHeight = sysInfo.statusBarHeight
//
this.height = sysInfo.statusBarHeight + 40
},
changeType (typeName, value) { changeType (typeName, value) {
if (this[typeName]!==value) { if (this[typeName]!==value) {
this[typeName]=value this[typeName]=value
@ -183,11 +189,8 @@
// //
getList(){ getList(){
let typeKey = `${this.type1}${this.type2}`
let tag_id = this.typeParam[typeKey]
this.Post({ this.Post({
tag_id: tag_id, tag_id: 60,
offset: this.list.length, offset: this.list.length,
limit: 10, limit: 10,
},'/api/tag/getGoodsByTagId').then(res => { },'/api/tag/getGoodsByTagId').then(res => {
@ -198,7 +201,7 @@
}) })
}, },
viewDetail(item) { viewDetail(item) {
this.goOtherDetail(item) // this.goOtherDetail(item)
if(!item.link_type) { if(!item.link_type) {
uni.navigateTo({ uni.navigateTo({
url: '/subPackages/techan/detail?id=' + item.id url: '/subPackages/techan/detail?id=' + item.id
@ -322,192 +325,144 @@
view { view {
box-sizing: border-box; box-sizing: border-box;
} }
.search-header{
.bg { width: 100%;
background:#F7F7F7; position: fixed;
min-height: 100vh; top: 0;
padding-bottom: 26rpx; left: 0;
} right: 0;
background: white;
.topLeft {
position: absolute;
left: 26rpx;
top: 101rpx;
font-size: 40rpx;
z-index: 2;
color: white;
background: rgba(0,0,0,0.5);
border-radius: 50%;
width: 60rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
box-sizing: border-box;
padding-right: 5rpx;
}
.topImg {
width: 750rpx;
height: 440rpx;
}
.box {
margin-top: 26.67rpx;
// border-radius: 20rpx 20rpx 0rpx 0rpx;
padding: 0 26.67rpx;
display: flex; display: flex;
flex-wrap: wrap; align-items: center;
justify-content: space-between; padding-left: 10rpx;
} padding-right: 120px;
.item { .input-model{
margin-bottom: 22rpx; flex: 1;
width: 335rpx; width: 1rpx;
height: 497rpx; height: 64rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(153,153,153,0.38); border-radius: 55rpx;
border-radius: 13rpx; border: 1rpx solid #20898D;
margin-left: 12rpx;
display: flex;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #ABAAAD;
padding-left: 24rpx;
}
.input-text{
height:19px;
padding-left: 14rpx;
font-weight: 400;
font-size: 24rpx;
}
} }
.item-img {
width: 100%;
height: 342rpx;
background: #87CD93;
border-radius: 13rpx 13rpx 0rpx 0rpx;
}
.content { .bg {
height: 145rpx; height: 100vh;
padding: 0 13rpx 13.33rpx; padding-bottom: 26rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; background: #F8FAFB;
} }
.title { .topImg {
font-family: PingFang SC; width: 750rpx;
font-weight: bold; height: 344rpx;
font-size: 29rpx; flex-shrink: 0;
color: #000000;
width: 291rpx;
} }
.bottom { .goods-container{
height: 1rpx;
flex: 1;
display: flex; display: flex;
justify-content: space-between;
align-items: center;
}
.price {
font-size: 34.67rpx;
font-family: PingFangSC;
// font-weight: bold;
color: #C3282E;
}
.price::before {
content: '¥';
font-size: 24rpx;
}
.price::after {
content: '起';
font-size: 24rpx;
color: #999999;
font-weight: 500;
} }
.buy { .left-container{
width: 140rpx; width: 214rpx;
height: 42rpx; flex-shrink: 0;
background: #C3282E; .type-item{
border-radius: 21rpx; font-weight: 400;
text-align: center; font-size: 24rpx;
line-height: 42rpx; color: #000000;
font-family: PingFang SC; text-align: center;
font-weight: 500; width: 216rpx;
font-size: 27rpx; height: 120rpx;
color: #FFFFFF; line-height: 120rpx;
} position: relative;
.buy-cart{ .active-type-bar{
width: 42rpx; position: absolute;
height: 42rpx; left: 0;
image{ top: 0;
width: 100%; bottom: 0;
height: 100%; height: 100%;
width: 12rpx;
background: #74A5AA;
}
}
.type-item.active{
background: linear-gradient( 90deg, rgba(32,137,141,0.4) 0%, rgba(32,137,141,0) 100%);
font-weight: 600;
font-size: 28rpx;
} }
} }
.right-container{
.type-container{ flex: 1;
width: 100%; width: 1rpx;
height: 227rpx; background: white;
padding: 40rpx 26rpx 0; padding-top: 32rpx;
background: #FFFFFF; .item {
.send-type-container{
width: 100%; width: 100%;
height: 66rpx; padding:0 32rpx 32rpx 32rpx;
padding: 4rpx;
background: #F2F2F2;
border-radius: 13rpx;
border: 1px solid #525251;
display: flex; display: flex;
.type{ .item-img {
flex: 1; width: 148rpx;
height: 148rpx;
border-radius: 15rpx;
flex-shrink: 0; flex-shrink: 0;
text-align: center; }
height: 100%; .content {
border-radius: 13rpx; height: 148rpx;
padding-left: 24rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
flex: 1;
}
.title {
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #525251; color: #000000;
width: 100%;
}
.bottom {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
justify-content: center; .price {
image{ font-size: 40rpx;
width: 25rpx; color: #FA0000;
height: 25rpx; font-weight: 400;
margin-right: 13rpx; }
.price::before {
content: '¥';
font-size: 24rpx;
} }
} }
.type.active{ .buy-cart{
color: #FFFFFF; width: 44rpx;
background: #525251; height: 44rpx;
} image{
} width: 100%;
height: 100%;
.goods-type-container{ }
width: 100%;
margin-top: 64rpx;
height: 55rpx;
display: flex;
.type {
flex: 1;
flex-shrink: 0;
height: 100%;
font-weight: 500;
font-size: 31rpx;
color: #666666;
display: flex;
justify-content: center;
position: relative;
}
.type.active{
color: #000000;
font-weight: bold;
}
.type.active::after{
content: '';
width: 67rpx;
height: 5rpx;
background: #525251;
border-radius: 3rpx;
position: absolute;
bottom: 0;
} }
} }
} }
.btn-list { .btn-list {
z-index: 99; z-index: 99;
position: fixed; position: fixed;
@ -519,7 +474,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 50rpx; padding: 0 26rpx;
.left-box { .left-box {
display: flex; display: flex;
@ -530,8 +485,8 @@
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
font-size: 27rpx; font-size: 27rpx;
color: #C3282E; color: #D70000;
padding: 0 33rpx; padding: 0 12rpx;
.bottom-price-yuan{ .bottom-price-yuan{
font-size: 40rpx; font-size: 40rpx;
} }
@ -540,6 +495,7 @@
font-size: 24rpx; font-size: 24rpx;
display: flex; display: flex;
align-items: center; align-items: center;
color: #0B898E;
} }
.img-box { .img-box {
@ -553,9 +509,9 @@
.btn-buy { .btn-buy {
width: 254rpx; width: 240rpx;
height: 78rpx; height: 78rpx;
background: #C3282E; background: #74A5AA;
border-radius: 40rpx; border-radius: 40rpx;
text-align: center; text-align: center;
line-height: 78rpx; line-height: 78rpx;
@ -575,7 +531,7 @@
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
.bottom-productImg { .bottom-productImg {
display: flex; display: flex;
margin-bottom: 23rpx; margin-bottom: 48rpx;
} }
.bottom-productImg img { .bottom-productImg img {
@ -611,7 +567,7 @@
width: 320rpx; width: 320rpx;
// height: 78rpx; // height: 78rpx;
border-radius: 13rpx; border-radius: 13rpx;
background-color: #F5F5F5; background-color: #EFEFEF;
font-size: 29rpx; font-size: 29rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
@ -642,12 +598,8 @@
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #FFFFFF;
} }
.botProducts { .botProducts {
// border: 1rpx solid #00AAFF; background: #74A5AA;
// background-color: rgba(254, 180, 25, 1);
background: #525251;
color: #FFFFFF; color: #FFFFFF;
} }
@ -661,6 +613,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
border-top: 1px solid #CCCCCC;
} }
.buy-num .number-btn { .buy-num .number-btn {
@ -681,20 +634,6 @@
font-size: 46rpx; font-size: 46rpx;
} }
.buy-btn {
width: 670rpx;
height: 78rpx;
text-align: center;
line-height: 78rpx;
background: linear-gradient(90deg, #C3282E, #FF9834);
border-radius: 40rpx;
font-size: 34rpx;
font-family: PingFangSC;
font-weight: 500;
color: #FFFFFF;
}
.btn-box { .btn-box {
width: 750rpx; width: 750rpx;
height: 151rpx; height: 151rpx;
@ -704,19 +643,6 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.sp {
width: 100%;
height: 30rpx;
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 400;
color: #060001;
line-height: 30rpx;
border-top: solid 2rpx #ccc;
margin: 60rpx 0;
padding-top: 30rpx;
}
} }
@ -733,12 +659,13 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(6,0,1,0.1);
.btn{ .btn{
width: 670rpx; width: 670rpx;
height: 78rpx; height: 78rpx;
text-align: center; text-align: center;
line-height: 78rpx; line-height: 78rpx;
background: #C3282E; background: #74A5AA;
border-radius: 40rpx; border-radius: 40rpx;
font-size: 34rpx; font-size: 34rpx;
@ -749,4 +676,5 @@
} }
} }
</style> </style>

134
subPackages/techan/order.vue

@ -11,7 +11,7 @@
</view> --> </view> -->
<!-- 邮寄 --> <!-- 邮寄 -->
<view class="address" style="margin-bottom: 36rpx;" v-if="info.is_post==1"> <view class="address" style="margin-bottom: 36rpx;">
<view class="a-title"> <view class="a-title">
<view>收货地址</view> <view>收货地址</view>
<view> <view>
@ -22,7 +22,7 @@
</view> </view>
<view class="btn-box"> <view class="btn-box">
<view class="contacts box" v-if="contacts && (info.is_post==1||info.is_post==3)"> <view class="contacts box" v-if="contacts">
<view class="contacts-left"> <view class="contacts-left">
<view class="name-phone"> <view class="name-phone">
<view class="name">{{ contacts.name }}</view> <view class="name">{{ contacts.name }}</view>
@ -39,7 +39,7 @@
</view> </view>
<!-- 自提 --> <!-- 自提 -->
<view v-if="info.is_post==2 && info.goods[0]"> <!-- <view v-if="info.is_post==2 && info.goods[0]">
<view class="pickself" > <view class="pickself" >
<navigator :url="`/subPackages/techan/selfPickUpPoint?pickupId=${pickupAddress.id}&goodsId=${info.goods[0].skuInfo.goods_id}`"> <navigator :url="`/subPackages/techan/selfPickUpPoint?pickupId=${pickupAddress.id}&goodsId=${info.goods[0].skuInfo.goods_id}`">
@ -75,7 +75,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<template v-for="(merchantGroup,merchantIndex) in orderGoods"> <template v-for="(merchantGroup,merchantIndex) in orderGoods">
<view class="new-box" v-for="(sku,index) in merchantGroup" :key="index"> <view class="new-box" v-for="(sku,index) in merchantGroup" :key="index">
@ -124,16 +124,16 @@
</view> </view>
</template> </template>
<view class="tickets-box flex-between"> <!-- <view class="tickets-box flex-between">
<view class="remark"> <view class="remark">
<view class="remark-title" >订单备注:</view> <view class="remark-title" >订单备注:</view>
<input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="remark" maxlength="50"/> <input style="z-index:0;text-align: right;" type="text" placeholder="选填" v-model="remark" maxlength="50"/>
</view> </view>
</view> </view> -->
<!-- 优惠券 --> <!-- 优惠券 -->
<view @click="goOrderCoupon" class="tickets-box flex-between"> <!-- <view @click="goOrderCoupon" class="tickets-box flex-between">
<view class="order-title">优惠券</view> <view class="order-title">优惠券</view>
<view class="coupon-btn" v-if="coupon==''"> <view class="coupon-btn" v-if="coupon==''">
<view class="select">选择优惠券</view> <view class="select">选择优惠券</view>
@ -144,7 +144,7 @@
<span v-else>-{{coupon.percent}}%</span> <span v-else>-{{coupon.percent}}%</span>
<span style="margin:0 31rpx 0 8rpx;color: #6C7A94;">></span> <span style="margin:0 31rpx 0 8rpx;color: #6C7A94;">></span>
</div> </div>
</view> </view> -->
@ -156,18 +156,18 @@
<view class="price">{{ total() }}</view> <view class="price">{{ total() }}</view>
<view class="post-text" v-if="info.is_post==1&&post">含邮费:¥{{ post / 100 }}</view> <view class="post-text" v-if="info.is_post==1&&post">含邮费:¥{{ post / 100 }}</view>
</view> </view>
<view class="btn" @click="order()">提交订单</view> <view class="btn" @click="order()">立即支付</view>
</view> </view>
<!-- 选择收货地址弹窗 --> <!-- 选择收货地址弹窗 -->
<uni-popup ref="addressPopup" type="bottom" backgroundColor="#F4F4F4" @change="changPopShow"> <uni-popup ref="addressPopup" type="bottom" backgroundColor="#F4F4F4" @change="changPopShow">
<view class="people-popup"> <view class="people-popup">
<!-- <view class="top-box"> <view class="top-box">
<view class="top flex-between"> <view class="top flex-between">
<text class="text-overflow" @click="changeAddressPopup('close')">取消</text> <text class="text-overflow" @click="changeAddressPopup('close')">取消</text>
<text class="confirm" @click="changeAddressPopup('close', 'confirm')">确定</text> <text class="confirm" @click="changeAddressPopup('close', 'confirm')">确定</text>
</view> </view>
</view> --> </view>
<!-- <navigator url="/subPackages/user/myAddressAdd" class="button">添加收货地址</navigator> --> <!-- <navigator url="/subPackages/user/myAddressAdd" class="button">添加收货地址</navigator> -->
<view class="button" @click="changeAddressAddPopup('open','',{})">添加收货地址</view> <view class="button" @click="changeAddressAddPopup('open','',{})">添加收货地址</view>
<view class="popup-list" v-if="addressList.length > 0"> <view class="popup-list" v-if="addressList.length > 0">
@ -215,7 +215,7 @@
</template> </template>
<script> <script>
import addressAddVue from '../../compoents/addressAdd.vue'; import addressAddVue from '../../components/addressAdd.vue';
export default { export default {
components: {addressAddVue}, components: {addressAddVue},
data() { data() {
@ -278,7 +278,7 @@ export default {
onReady () { onReady () {
this.$nextTick(()=>{ this.$nextTick(()=>{
setTimeout(()=>{ setTimeout(()=>{
this.getMaxCouponData() // this.getMaxCouponData()
},1000) },1000)
}) })
@ -839,31 +839,6 @@ view {
font-weight: 500; font-weight: 500;
color: #000000; color: #000000;
.price-list {
display: flex;
margin-top: 18rpx;
align-items: center;
.price-r {
font-size: 32rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #fc5109;
&:before {
content: '¥';
display: inline-block;
color: #fc5109;
font-size: 24rpx;
}
}
.price-g {
font-size: 24rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #b5bcc9;
text-decoration: line-through;
margin-left: 10rpx;
}
}
} }
.num-box { .num-box {
display: flex; display: flex;
@ -878,7 +853,7 @@ view {
.ctrl { .ctrl {
width: 47rpx; width: 47rpx;
height: 47rpx; height: 47rpx;
background: #515150; background: #74A5AA;
border-radius: 50%; border-radius: 50%;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
@ -901,26 +876,25 @@ view {
display: flex; display: flex;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
padding: 20rpx 20rpx; padding: 20rpx 20rpx 40rpx;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.btn { .btn {
width: 294rpx; width: 250rpx;
height: 88rpx; height: 80rpx;
background: #C3282E; background: #74A5AA;
border-radius: 43rpx; border-radius: 40rpx;
text-align: center; text-align: center;
line-height: 88rpx; line-height: 80rpx;
font-size: 36rpx; font-weight: bold;
font-family: PingFang SC; font-size: 32rpx;
font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
} }
.price-box { .price-box {
display: flex; display: flex;
align-items: center; align-items: flex-end;
.text { .text {
font-size: 29rpx; font-size: 29rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
@ -929,15 +903,15 @@ view {
} }
.price { .price {
margin-left: 15rpx; margin-left: 15rpx;
font-size: 36rpx; font-size: 48rpx;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight: bold; font-weight: bold;
color: #C3282E; color: #FC5109;
line-height: 1;
&:before { &:before {
content: '¥'; content: '¥';
display: inline-block; display: inline-block;
color: #C3282E; font-size: 24rpx;
font-size: 36rpx;
} }
} }
.post-text { .post-text {
@ -978,7 +952,7 @@ view {
font-size: 27rpx; font-size: 27rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 400; font-weight: 400;
color: #000; color: #6C7A94;
margin-top: 20rpx; margin-top: 20rpx;
max-width: 500rpx; max-width: 500rpx;
} }
@ -1063,7 +1037,7 @@ view {
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
background: #515150; background: #74A5AA;
} }
} }
@ -1077,62 +1051,16 @@ view {
flex: 1; flex: 1;
text-align: left; text-align: left;
margin-top: 33rpx; margin-top: 33rpx;
color: #666666; color: #333333;
font-size: 25rpx; font-size: 25rpx;
.mobile {
margin-bottom: 36rpx;
}
}
.status {
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
border-radius: 50%;
text-align: center;
box-sizing: border-box;
img {
width: 27rpx;
height: 21rpx;
}
}
.statuss {
background: linear-gradient(90deg, #fa2b66, #ff9834);
border: none;
}
.noSelect {
border: 1rpx solid #999999;
} }
} }
.item-site {
color: #666666;
display: flex;
align-items: center;
padding: 36rpx 0;
view {
width: 23rpx;
height: 23rpx;
margin-right: 10rpx;
border: 1rpx solid #999999;
border-radius: 50%;
view {
width: 8rpx;
height: 8rpx;
background: #000000;
border-radius: 50%;
margin: auto;
}
}
}
} }
.popup-item.active{ .popup-item.active{
background: #515150; background: #60989E;
} }
} }

Loading…
Cancel
Save