Browse Source

合并修改

master
杨豪 3 years ago
parent
commit
c0e156747c
  1. 1
      App.vue
  2. 12
      api/user.js
  3. 66
      components/sSwiper.vue
  4. 99
      components/vSwiper.vue
  5. 4
      config/index.js
  6. 3
      main.js
  7. 85
      pages/demandHall/resourcesDetail/index.vue
  8. 1
      pages/home/index.vue
  9. 87
      pages/life/addGoods/index.vue
  10. 2
      pages/life/index.vue
  11. 105
      pages/life/temp/index.vue
  12. 44
      pages/life/tempList/index.vue
  13. 11
      pages/order/OrderSubmission/index.vue
  14. 18
      pages/shop/GoodsCon/index.vue
  15. 8
      pages/user/agreement/index.vue
  16. 9
      pages/user/goodsManage/index.vue
  17. 5
      pages/user/index.vue
  18. 2
      pages/user/openStore/index.vue
  19. BIN
      static/images/edit-icon.png
  20. 22
      uni_modules/uni-badge/changelog.md
  21. 253
      uni_modules/uni-badge/components/uni-badge/uni-badge.vue
  22. 88
      uni_modules/uni-badge/package.json
  23. 58
      uni_modules/uni-badge/readme.md

1
App.vue

@ -251,7 +251,6 @@ export default {
setMenuHeight() { setMenuHeight() {
uni.getSystemInfo({ uni.getSystemInfo({
success: res => { success: res => {
console.log(res);
this.globalData.navTopHeight = res.statusBarHeight; this.globalData.navTopHeight = res.statusBarHeight;
this.globalData.CustomBar = res.statusBarHeight + 45; this.globalData.CustomBar = res.statusBarHeight + 45;
this.globalData.systemInfo = res; this.globalData.systemInfo = res;

12
api/user.js

@ -31,6 +31,12 @@ export function addTemp(data) {
login: true, login: true,
}) })
} }
//删除运费模板
export function delTemp(data) {
return request.delete('/user/shippingtemplate?ids=' + data, {
login: true,
})
}
//获取运费模板列表 //获取运费模板列表
export function getTempList(data) { export function getTempList(data) {
@ -38,6 +44,12 @@ export function getTempList(data) {
login: true, login: true,
}) })
} }
//获取运费模板详情
export function getTempDetail(data) {
return request.get('/user/shippingtemplate/getTemplatesDetail?id='+data, {
login: true,
})
}
/** /**
* 用户登录 * 用户登录

66
components/sSwiper.vue

@ -0,0 +1,66 @@
<template>
<swiper class="swiper-block" autoplay="true" circular="true" previous-margin="90rpx" next-margin="90rpx" current="0" @change="swiperChange">
<block v-for="(item, index) in imgs" :key="index">
<swiper-item class="swiper-item" :class="(swiperIndex == index ? 'active' : '')" @tap="previewImg">
<image mode="aspectFill" :src="item" :class="'slide-image ' + (swiperIndex == index ? 'active' : '')"></image>
</swiper-item>
</block>
</swiper>
</template>
<script>
export default{
props: {
imgs: {
type: Array,
default: []
}
},
data(){
return {
swiperIndex: 0
}
},
methods: {
swiperChange(e) {
const that = this;
that.setData({
swiperIndex: e.detail.current
});
},
previewImg() {
uni.previewImage({
urls: this.imgs
});
}
}
}
</script>
<style lang="less">
.swiper-block {
height: 300rpx;
width: 100%;
}
.swiper-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
overflow: unset;
}
.slide-image {
height: 250rpx;
width: 520rpx;
border-radius: 9rpx;
margin: 0rpx 30rpx;
z-index: 1;
}
.active {
transform: scale(1.14);
transition: all 0.2s ease-in 0s;
z-index: 20;
}
</style>

99
components/vSwiper.vue

@ -0,0 +1,99 @@
<template>
<swiper class="swiper-block" vertical="true" circular="true" previous-margin="90rpx" next-margin="90rpx" current="0" @change="swiperChange">
<block v-for="(item, index) in imgs" :key="index">
<swiper-item class="swiper-item" :class="(swiperIndex == index ? 'active' : '')" @tap="previewImg">
<view class="item-box" :class="(swiperIndex == index ? 'active' : '')">
<image mode="aspectFill" :src="item" class="slide-image"></image>
<view class="content-box">
<view class="title-box">标题标题标题标题标题</view>
<view class="content acea-row">
<view>云快讯</view>
<view>3小时钱</view>
<view>300阅读</view>
</view>
</view>
</view>
</swiper-item>
</block>
</swiper>
</template>
<script>
export default{
props: {
imgs: {
type: Array,
default: []
}
},
data(){
return {
swiperIndex: 0
}
},
methods: {
swiperChange(e) {
const that = this;
that.setData({
swiperIndex: e.detail.current
});
},
previewImg() {
uni.previewImage({
urls: this.imgs
});
}
}
}
</script>
<style lang="less">
.swiper-block {
width: 670rpx;
height: 300rpx;
margin: 60rpx auto;
}
.swiper-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: unset;
}
.item-box{
width: 622rpx;
height: 200rpx;
position: relative;
border-radius: 20rpx;
}
.slide-image {
width: 100%;
height: 100%;
z-index: 1;
border-radius: 20rpx;
}
.content-box{
position: absolute;
bottom: 20rpx;
left: 20rpx;
color: #0081FF;
z-index: 5;
}
.title-box{
font-size: 32rpx;
font-weight: 500;
color: #fff;
}
.content{
color: #fff;
font-size: 26rpx;
}
.active {
transform: scale(1.02);
transition: all 0.2s ease-in 0s;
border-radius: 20rpx;
z-index: 20;
}
</style>

4
config/index.js

@ -1,8 +1,8 @@
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api' // export const VUE_APP_API_URL = 'https://wxapi.yixiang.co/api'
// export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api' // export const VUE_APP_API_URL = 'http://192.168.0.112:8092/api'
// export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api' export const VUE_APP_API_URL = 'http://192.168.0.111:8092/api'
export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api' // export const VUE_APP_API_URL = 'https://cloud.api.cyjyyjy.com/api'
// export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'http://natapp.xinxintuan.co/api';
// export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api' // export const VUE_APP_API_URL = 'https://thapi.xinxintuan.co/api'
// export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api'; // export const VUE_APP_API_URL = 'https://h5api.xinxintuan.co/api';

3
main.js

@ -45,6 +45,9 @@ Object.defineProperty(Vue.prototype, '$yroute', {
}, },
}) })
console.log(Vue.prototype)
console.log(Object.getPrototypeOf(Vue))
let deviceType = '' let deviceType = ''
// #ifdef APP-PLUS // #ifdef APP-PLUS
// App平台编译的代码 // App平台编译的代码

85
pages/demandHall/resourcesDetail/index.vue

@ -49,13 +49,8 @@
</view> </view>
</view> </view>
<view> <view>
<swiper class="swiper-block" autoplay="true" circular="true" previous-margin="90rpx" next-margin="90rpx" current="0" @change="swiperChange"> <sSwiper :imgs="detail.resourceImgs"></sSwiper>
<block v-for="(item, index) in detail.resourceImgs" :key="index"> <vSwiper :imgs="detail.resourceImgs"></vSwiper>
<swiper-item class="swiper-item" @tap="previewImg">
<image mode="aspectFill" :src="item" :class="'slide-image ' + (swiperIndex == index ? 'active' : '')"></image>
</swiper-item>
</block>
</swiper>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<view class="contact-btn" @tap="toResourcesContact">立即沟通</view> <view class="contact-btn" @tap="toResourcesContact">立即沟通</view>
@ -66,7 +61,8 @@
<script> <script>
// pages/demandHall/resourcesDetail/index.js // pages/demandHall/resourcesDetail/index.js
const app = getApp(); const app = getApp();
import sSwiper from '@/components/sSwiper.vue'
import vSwiper from '@/components/vSwiper.vue'
export default { export default {
data() { data() {
return { return {
@ -75,8 +71,7 @@ export default {
swiperIndex: 0 swiperIndex: 0
}; };
}, },
components: { sSwiper, vSwiper },
components: {},
props: {}, props: {},
/** /**
@ -88,37 +83,6 @@ export default {
}); });
this.getDetail(); this.getDetail();
}, },
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
@ -175,20 +139,6 @@ export default {
} }
}); });
}, },
swiperChange(e) {
const that = this;
that.setData({
swiperIndex: e.detail.current
});
},
previewImg() {
uni.previewImage({
urls: this.detail.resourceImgs
});
}
} }
}; };
</script> </script>
@ -324,29 +274,4 @@ export default {
color: #707070; color: #707070;
line-height: 40rpx; line-height: 40rpx;
} }
.swiper-block {
height: 300rpx;
width: 100%;
}
.swiper-item {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
overflow: unset;
}
.slide-image {
height: 250rpx;
width: 520rpx;
border-radius: 9rpx;
margin: 0rpx 30rpx;
z-index: 1;
}
.active {
transform: scale(1.14);
transition: all 0.2s ease-in 0s;
z-index: 20;
}
</style> </style>

1
pages/home/index.vue

@ -231,6 +231,7 @@ export default {
} }
}, },
onLoad() { onLoad() {
uni.hideTabBar(); uni.hideTabBar();
// app.globalData.editTabbar(); // app.globalData.editTabbar();
this.pagePath = '/pages/home/index' this.pagePath = '/pages/home/index'

87
pages/life/addGoods/index.vue

@ -89,7 +89,7 @@
<image src="../../../static/images/arror-r-s.png"></image> <image src="../../../static/images/arror-r-s.png"></image>
</view> </view>
</view> </view>
<view class="temp-box goods-state acea-row row-between-wrapper"> <!-- <view class="temp-box goods-state acea-row row-between-wrapper">
<text>商品状态</text> <text>商品状态</text>
<view class="acea-row row-middle"> <view class="acea-row row-middle">
<radio-group @change="radioChange"> <radio-group @change="radioChange">
@ -101,7 +101,7 @@
</label> </label>
</radio-group> </radio-group>
</view> </view>
</view> </view> -->
<view class="btn-box"> <view class="btn-box">
<view class="btn" @tap="submit">提交</view> <view class="btn" @tap="submit">提交</view>
</view> </view>
@ -237,6 +237,8 @@
this.attrArr = info.items this.attrArr = info.items
this.spec_type = 1 this.spec_type = 1
this.isShow = info.is_show this.isShow = info.is_show
this.tempId = info.shippingTemplatesDto.id
this.temp = info.name
let strArr = info.items.map(item=>{ let strArr = info.items.map(item=>{
return item.value return item.value
}) })
@ -291,6 +293,9 @@
this.addOptionsDialog = true this.addOptionsDialog = true
}, },
delAttr(i){ delAttr(i){
if(this.attrArr.length == 1){
return this.alertMessage('至少有一个规格')
}
this.attrArr.splice(i,1) this.attrArr.splice(i,1)
this.getFormatAttr() this.getFormatAttr()
}, },
@ -303,16 +308,16 @@
/// ///
submitAddAttr(){ submitAddAttr(){
if(this.attr.value == ''){ if(this.attr.value == ''){
return uni.showToast({ return this.alertMessage('请填写属性名称','none')
title: '请填写属性名称!',
icon: 'none'
})
} }
try{ try{
var o = this.attr.detail; var o = this.attr.detail;
if(o.length == 0){
throw "请至少填写一个属性值!";
}
o.forEach(function(item,index) { o.forEach(function(item,index) {
if(item == ""){ if(item == ""){
throw "属性规格不能为空!"; throw "属性不能为空!";
} }
}); });
} catch(e){ } catch(e){
@ -337,19 +342,13 @@
if(res.success){ if(res.success){
this.$set(this.batchData,'priceArr',res.data.value) this.$set(this.batchData,'priceArr',res.data.value)
if(res.data.attr){ if(res.data.attr){
let strArr = res.data.attr.map(item=>{ let strArr = res.data.attr.map(item=> item.value)
return item.value
})
this.$set(this.batchData,'titleStr',strArr.join('/')) this.$set(this.batchData,'titleStr',strArr.join('/'))
} else{ } else{
this.$set(this.batchData,'titleStr','') this.$set(this.batchData,'titleStr','')
} }
} else{ } else{
uni.showToast({ this.alertMessage(res.msg)
title: res.msg,
icon: 'none'
})
} }
}) })
}, },
@ -391,7 +390,6 @@
} else{ } else{
this.attrValTitle = '批量修改规格' this.attrValTitle = '批量修改规格'
} }
this.showAttrVal= true this.showAttrVal= true
}, },
cancelClick(){ cancelClick(){
@ -400,7 +398,7 @@
}, },
submitClick(){ submitClick(){
const idx = this.idx const idx = this.idx
console.log(this.price,this.ot_price,this.stock) // console.log(this.price,this.ot_price,this.stock)
if(this.stock == 0){ if(this.stock == 0){
return this.alertMessage('商品库存不能为0') return this.alertMessage('商品库存不能为0')
} }
@ -414,9 +412,6 @@
this.$set(this.batchData.priceArr[idx],'price',this.price) this.$set(this.batchData.priceArr[idx],'price',this.price)
this.$set(this.batchData.priceArr[idx],'ot_price',this.ot_price) this.$set(this.batchData.priceArr[idx],'ot_price',this.ot_price)
this.$set(this.batchData.priceArr[idx],'stock',this.stock) this.$set(this.batchData.priceArr[idx],'stock',this.stock)
// this.batchData.priceArr[idx].price= this.price
// this.batchData.priceArr[idx].ot_price= this.ot_price
// this.batchData.priceArr[idx].stock= this.stock
} }
this.showAttrVal= false this.showAttrVal= false
}, },
@ -436,77 +431,59 @@
isShow: this.isShow, isShow: this.isShow,
items: this.items items: this.items
} }
console.log(form.slider_image[0])
if(form.store_name == ''){ if(form.store_name == ''){
this.alertMessage('请填写商品名称') return this.alertMessage('请填写商品名称','none')
return } else if(form.slider_image[0]){
} else if(form.slider_image[0] == ''){ return this.alertMessage('请至少上传一张商品图片','none')
this.alertMessage('请至少上传一张商品图片')
return
} else if(form.description == ''){ } else if(form.description == ''){
this.alertMessage('请填写商品详情') return this.alertMessage('请填写商品详情','none')
return
} else if(form.description == ''){ } else if(form.description == ''){
this.alertMessage('请填写商品详情') return this.alertMessage('请填写商品详情','none')
return
} }
form.attrs.forEach((item,index)=>{ form.attrs.forEach((item,index)=>{
if(item.price == '' || item.price == 0){ if(item.price == '' || item.price == 0){
this.alertMessage('请商品规格价格') return this.alertMessage('请商品规格价格','none')
return
} else if(item.stock == '' || item.stock == 0){ } else if(item.stock == '' || item.stock == 0){
this.alertMessage('库存不能为0') return this.alertMessage('商品规格库存不能为0','none')
return
} }
}) })
if(this.id != ''){ if(this.id != ''){
form.id = this.id form.id = this.id
form.spec_type = this.spec_type form.spec_type = this.spec_type
console.log(form)
editProduct(form).then((res)=>{ editProduct(form).then((res)=>{
if(res.success){ if(res.success){
uni.showToast({ this.alertMessage(res.msg,'success')
title: res.msg,
duration: 1500
})
setTimeout((res)=>{ setTimeout((res)=>{
uni.redirectTo({ uni.redirectTo({
url: '/pages/user/goodsManage/index' url: '/pages/user/goodsManage/index?type=' + 0
}); });
},1500) },1500)
} else{ } else{
uni.showToast({ this.alertMessage(res.msg,'none')
title: res.msg,
icon: 'none'
})
} }
}) })
} else{ } else{
form.spec_type = this.batchData.priceArr.length > 1 ? 1 : 0 form.spec_type = this.batchData.priceArr.length > 1 ? 1 : 0
console.log(form)
addProduct(form).then((res)=>{ addProduct(form).then((res)=>{
if(res.success){ if(res.success){
uni.showToast({ this.alertMessage(res.msg,'success')
title: res.msg,
duration: 1500
})
setTimeout((res)=>{ setTimeout((res)=>{
uni.redirectTo({ uni.redirectTo({
url: '/pages/user/goodsManage/index' url: '/pages/user/goodsManage/index?type=' + 0
}); });
},1500) },1500)
} else{ } else{
uni.showToast({ this.alertMessage(res.msg,'none')
title: res.msg,
icon: 'none'
})
} }
}) })
} }
}, },
alertMessage(msg){ alertMessage(msg,type){
uni.showToast({ uni.showToast({
title: msg, title: msg,
icon: 'none' icon: type,
duration: 1500
}) })
} }
} }

2
pages/life/index.vue

@ -179,7 +179,7 @@ export default {
} else{ } else{
this.flowList = res.data this.flowList = res.data
} }
this.isLoad = this.limit <= res.data.length // this.isLoad = this.limit <= res.data.length
if(this.limit <= res.data.length){ //length if(this.limit <= res.data.length){ //length
this.isLoad = true this.isLoad = true
} else{ } else{

105
pages/life/temp/index.vue

@ -22,9 +22,9 @@
<view class="step-freight-box"> <view class="step-freight-box">
<view class="acea-row row-between"> <view class="acea-row row-between">
<view>阶梯运费</view> <view>阶梯运费</view>
<switch :checked="setpFreight" color="#FF6D31" style="transform:scale(0.7)" @change="switchChange" /> <switch :checked="templateList[0]" color="#FF6D31" style="transform:scale(0.7)" @change="switchChange" />
</view> </view>
<view class="step-box" v-show="setpFreight"> <view class="step-box" v-show="templateList[0]">
<view class="acea-row row-middle row-center"> <view class="acea-row row-middle row-center">
<input class="inp-price" type="text" v-model="templateList[0].first" /> <input class="inp-price" type="text" v-model="templateList[0].first" />
<text>{{type == 0 ? '件' : 'kg' }}()</text> <text>{{type == 0 ? '件' : 'kg' }}()</text>
@ -87,76 +87,8 @@
const app = getApp(); const app = getApp();
import selectTree from "@/components/select-tree/select-tree" import selectTree from "@/components/select-tree/select-tree"
import tkiTree from "@/components/tki-tree/tki-tree.vue" import tkiTree from "@/components/tki-tree/tki-tree.vue"
import { getCity, citys, addTemp } from "@/api/user"; import { getCity, citys, addTemp, getTempDetail } from "@/api/user";
let testList = [
{
city_id: 1,
id: 1,
isShow: 1,
lat: "39.904030",
level: 0,
lng: "116.407526",
mergerName: "北京",
name: "北京市",
parentId: 0,
children: [
{
areaCode: "110100000000",
children: null,
city_id: 2,
id: 35,
isShow: 1,
lat: "39.904030",
level: 1,
lng: "116.407526",
mergerName: "北京",
name: "北京市",
parentId: 1,
},
]
},
{
areaCode: "130000000000",
children: [
{
areaCode: "130100000000",
children: null,
city_id: 13268,
id: 37,
isShow: 1,
lat: "38.042306",
level: 1,
lng: "114.514859",
mergerName: "河北,石家庄",
name: "石家庄市",
parentId: 13267,
},
{
areaCode: "130200000000",
children: null,
city_id: 18128,
id: 38,
isShow: 1,
lat: "39.630867",
level: 1,
lng: "118.180193",
mergerName: "河北,唐山",
name: "唐山市",
parentId: 13267,
}
],
city_id: 13267,
id: 3,
isShow: 1,
lat: "38.037057",
level: 0,
lng: "114.468664",
mergerName: "河北",
name: "河北省",
parentId: 0,
}
]
var g = [ var g = [
{ {
region: [ region: [
@ -182,17 +114,36 @@ export default {
name: "", name: "",
type:0, type:0,
setpFreight: false, setpFreight: false,
list: testList, list: [],
templateList: g templateList: g,
id: null
}; };
}, },
mounted(){ mounted(){
if(this.$yroute.query.id){
this.id = this.$yroute.query.id
this.getTempDetail(this.$yroute.query.id)
}
citys().then((res)=>{ citys().then((res)=>{
let data = res.data; let data = res.data;
this.list = data this.list = data
}) })
}, },
methods: { methods: {
getTempDetail(id){
getTempDetail(id).then((res)=>{
if(res.success){
this.name= res.data.name
this.type= res.data.type
this.templateList = res.data.region_info
this.templateList.forEach((item)=>{
item.setpFreight = true
})
} else{
this.alertMessage(res.msg)
}
})
},
radioChange(e){ radioChange(e){
this.type = e.detail.value this.type = e.detail.value
}, },
@ -208,13 +159,13 @@ export default {
this.$refs.tkitree._show(); this.$refs.tkitree._show();
}, },
delTempItem(idx){ delTempItem(idx){
console.log(idx)
this.templateList.splice(idx,1) this.templateList.splice(idx,1)
}, },
// //
treeConfirm(e) { treeConfirm(e) {
// console.log(e,'') console.log(e,'确认')
// console.log(this.list,'') console.log(this.list,'列表')
if(e.length == 0) return
let list = this.list; let list = this.list;
let selectCity = e; let selectCity = e;
let selectName = []; let selectName = [];
@ -260,13 +211,13 @@ export default {
// //
treeCancel(e) { treeCancel(e) {
console.log(e) console.log(e)
}, },
submit(){ submit(){
let form = {} let form = {}
form.name = this.name form.name = this.name
form.type = this.type form.type = this.type
form.region_info = this.templateList form.region_info = this.templateList
form.id = this.id
if(form.name == '' ){ if(form.name == '' ){
return this.alertMessage('请填写模板名字') return this.alertMessage('请填写模板名字')

44
pages/life/tempList/index.vue

@ -5,9 +5,14 @@
<view class="temp-name"> <view class="temp-name">
{{index + 1}}{{item.name}} {{index + 1}}{{item.name}}
</view> </view>
<view class="acea-row row-middle">
<view class="handle-btn" @tap.stop="del(item)"> <view class="handle-btn" @tap.stop="del(item)">
<image src="../../../static/images/del-goods.png"></image> <image src="../../../static/images/del-goods.png"></image>
</view> </view>
<view class="handle-btn" @tap.stop="edit(item)">
<image src="../../../static/images/edit-icon.png"></image>
</view>
</view>
</view> </view>
</view> </view>
<view class="btn-box" @tap.stop="toTemp">新增运费模板</view> <view class="btn-box" @tap.stop="toTemp">新增运费模板</view>
@ -15,7 +20,7 @@
</template> </template>
<script> <script>
import { getTempList } from '@/api/user' import { getTempList, delTemp } from '@/api/user'
export default{ export default{
data(){ data(){
return { return {
@ -46,7 +51,24 @@
} }
}, },
del(item){ del(item){
let id = [item.id]
if(item.id == 1) return uni.showToast({ title: '默认模板不可删除!', icon:'none', })
uni.showModal({
title: '提示!',
content: '是否确认删除运费模板?',
success: (r) => {
if(r.confirm){
delTemp(id).then((res)=>{
if(res.success){
this.alertMessage('操作成功!')
this.getTempList()
} else{
this.alertMessage(res.msg)
}
})
}
}
})
}, },
getTempList(){ getTempList(){
getTempList().then((res)=>{ getTempList().then((res)=>{
@ -59,6 +81,17 @@
uni.navigateTo({ uni.navigateTo({
url:'/pages/life/temp/index' url:'/pages/life/temp/index'
}) })
},
edit(item){
uni.navigateTo({
url:'/pages/life/temp/index?id='+ item.id
})
},
alertMessage(msg){
uni.showToast({
title: msg,
icon: 'none'
})
} }
} }
} }
@ -94,9 +127,12 @@
} }
.handle-btn{ .handle-btn{
margin-left: 12rpx; margin-left: 12rpx;
width: 38rpx;
height: 100%;
text-align: center;
image{ image{
width: 29rpx; width: 35rpx;
height: 29rpx; height: 35rpx;
} }
} }
} }

11
pages/order/OrderSubmission/index.vue

@ -67,7 +67,7 @@
</view> </view>
</view> </view>
</view> --> </view> -->
<view class="item acea-row row-between-wrapper" v-if="!isIntegral && deduction === false && enableIntegral === true"> <!-- <view class="item acea-row row-between-wrapper" v-if="!isIntegral && deduction === false && enableIntegral === true">
<view>当前积分</view> <view>当前积分</view>
<view class="discount"> <view class="discount">
<view class="select-btn"> <view class="select-btn">
@ -80,12 +80,13 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view> -->
<view class="item acea-row row-between-wrapper" v-if="shipping_type === 0"> <view class="item acea-row row-between-wrapper" v-if="shipping_type === 0">
<view>快递费用</view> <view>快递费用</view>
<view class="discount"> <!-- <view class="discount">
{{ orderGroupInfo.priceGroup.storePostage > 0 ? orderGroupInfo.priceGroup.storePostage : '免运费' }} {{ orderGroupInfo.priceGroup.storePostage > 0 ? orderGroupInfo.priceGroup.storePostage : '免运费' }}
</view> </view> -->
<view class="discount">{{ orderPrice.payPostage }}</view>
</view> </view>
<view v-if="shipping_type === 1"> <view v-if="shipping_type === 1">
<view class="item acea-row row-between-wrapper"> <view class="item acea-row row-between-wrapper">
@ -137,7 +138,7 @@
</view> </view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0 && !isIntegral"> <view class="item acea-row row-between-wrapper" v-if="orderPrice.payPostage > 0 && !isIntegral">
<view>运费</view> <view>运费</view>
<view class="money">{{ orderPrice.payPostage }}</view> <view class="money" v-if="Number(orderPrice.payPostage) > 0">{{ orderPrice.payPostage }}</view>
</view> </view>
<view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0 && !isIntegral"> <view class="item acea-row row-between-wrapper" v-if="orderPrice.couponPrice > 0 && !isIntegral">
<view>优惠券抵扣</view> <view>优惠券抵扣</view>

18
pages/shop/GoodsCon/index.vue

@ -23,8 +23,8 @@
<view class="introduce">{{ storeInfo.storeName }}</view> <view class="introduce">{{ storeInfo.storeName }}</view>
<view class="label acea-row row-between-wrapper"> <view class="label acea-row row-between-wrapper">
<!-- <text v-if="!isIntegral">原价:{{ storeInfo.otPrice }}</text> --> <!-- <text v-if="!isIntegral">原价:{{ storeInfo.otPrice }}</text> -->
<text>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</text> <text>库存:{{ storeInfo.stock }}</text>
<text>已售:{{ storeInfo.sales }}{{ storeInfo.unitName }}</text> <text>已售:{{ storeInfo.sales }}</text>
</view> </view>
<view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length"> <view class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
<text class="hide line1"> <text class="hide line1">
@ -292,7 +292,7 @@ export default {
isIntegral: false, isIntegral: false,
} }
}, },
computed: mapGetters(['isLogin', 'location']), computed: mapGetters(['isLogin', 'location', 'userInfo']),
mounted: function() { mounted: function() {
this.$store.commit('get_to', 'goodcon') this.$store.commit('get_to', 'goodcon')
let url = handleQrCode() let url = handleQrCode()
@ -632,6 +632,12 @@ export default {
// //
joinCart: function() { joinCart: function() {
//0= //0=
if(uni.getStorageSync('uid') == this.storeInfo.merId){
return uni.showToast({
title: '不可以购买自己发布的商品!',
icon: 'none'
})
}
this.goCat(0) this.goCat(0)
}, },
// //
@ -726,6 +732,12 @@ export default {
}, },
// //
tapBuy: function() { tapBuy: function() {
if(uni.getStorageSync('uid') == this.storeInfo.merId){
return uni.showToast({
title: '不可以购买自己发布的商品!',
icon: 'none'
})
}
// 1= // 1=
this.goCat(1) this.goCat(1)
}, },

8
pages/user/agreement/index.vue

@ -217,19 +217,24 @@ export default {
width: 100%; width: 100%;
position: relative; position: relative;
} }
.agreement-box image { .agreement-box image {
width: 100%; width: 100%;
display: block; display: block;
} }
.agreement-box .img { .agreement-box .img {
height: 2848rpx; height: 2848rpx;
} }
.agreement-box .img1 { .agreement-box .img1 {
height: 924rpx; height: 924rpx;
} }
.agreement-box .img2 { .agreement-box .img2 {
height: 834rpx; height: 834rpx;
} }
.agreement-box .img3 { .agreement-box .img3 {
height: 1090rpx; height: 1090rpx;
} }
@ -249,13 +254,16 @@ export default {
width: 100%; width: 100%;
min-height: 100vh; min-height: 100vh;
} }
.pay-box image { .pay-box image {
width: 100%; width: 100%;
display: block; display: block;
} }
.pay-box .img1 { .pay-box .img1 {
height: 609rpx; height: 609rpx;
} }
.pay-box .img2 { .pay-box .img2 {
height: 1235rpx; height: 1235rpx;
} }

9
pages/user/goodsManage/index.vue

@ -1,10 +1,10 @@
<template> <template>
<view class="goodsManage-page"> <view class="goodsManage-page">
<view class="nav acea-row row-around"> <view class="nav acea-row row-around">
<view class="item" :class="{ on: type === 1 }" @click="changeType(1)"> <view class="item" :class="{ on: type == 1 }" @click="changeType(1)">
<view>出售中</view> <view>出售中</view>
</view> </view>
<view class="item" :class="{ on: type === 0 }" @click="changeType(0)"> <view class="item" :class="{ on: type == 0 }" @click="changeType(0)">
<view>待上架</view> <view>待上架</view>
</view> </view>
</view> </view>
@ -60,12 +60,15 @@
} }
}, },
onShow() { onShow() {
this.$yroute.query.type ? this.type = this.$yroute.query.type : this.type = 1
this.getProducts() this.getProducts()
let pages = getCurrentPages(); let pages = getCurrentPages();
console.log(pages)
}, },
onReachBottom() { onReachBottom() {
if(this.loading){
this.page= this.page + 1
this.getProducts() this.getProducts()
}
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.goodsList = [] this.goodsList = []

5
pages/user/index.vue

@ -230,7 +230,6 @@ export default {
userInfo: {}, userInfo: {},
CustomBar: app.globalData.CustomBar, CustomBar: app.globalData.CustomBar,
menuHeight: app.globalData.menuHeight, menuHeight: app.globalData.menuHeight,
navHeight: app.globalData.navHeight,
menuTop: app.globalData.menuTop, menuTop: app.globalData.menuTop,
demandCounts: 0, demandCounts: 0,
supplyCounts: 0, supplyCounts: 0,
@ -250,10 +249,9 @@ export default {
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
// app.globalData.editTabbar();
this.getInfo(); this.getInfo();
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
@ -311,7 +309,6 @@ export default {
}, },
toAuth() { toAuth() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/release/index' url: '/pages/release/index'
}); });

2
pages/user/openStore/index.vue

@ -146,7 +146,7 @@
min-height: 100vh; min-height: 100vh;
background: #eee; background: #eee;
.form-box{ .form-box{
padding: 0rpx 40rpx; padding: 20rpx 40rpx;
.form-item{ .form-item{
width: 100%; width: 100%;
padding: 30rpx 28rpx; padding: 30rpx 28rpx;

BIN
static/images/edit-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

22
uni_modules/uni-badge/changelog.md

@ -0,0 +1,22 @@
## 1.1.6(2021-09-22)
- 修复 在字节小程序上样式不生效的 bug
## 1.1.5(2021-07-30)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.1.4(2021-07-29)
- 修复 去掉 nvue 不支持css 的 align-self 属性,nvue 下不暂支持 absolute 属性
## 1.1.3(2021-06-24)
- 优化 示例项目
## 1.1.1(2021-05-12)
- 新增 组件示例地址
## 1.1.0(2021-05-12)
- 新增 uni-badge 的 absolute 属性,支持定位
- 新增 uni-badge 的 offset 属性,支持定位偏移
- 新增 uni-badge 的 is-dot 属性,支持仅显示有一个小点
- 新增 uni-badge 的 max-num 属性,支持自定义封顶的数字值,超过 99 显示99+
- 优化 uni-badge 属性 custom-style, 支持以对象形式自定义样式
## 1.0.7(2021-05-07)
- 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
- 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
- 新增 uni-badge 属性 custom-style, 支持自定义样式
## 1.0.6(2021-02-04)
- 调整为uni_modules目录规范

253
uni_modules/uni-badge/components/uni-badge/uni-badge.vue

@ -0,0 +1,253 @@
<template>
<view class="uni-badge--x">
<slot />
<text v-if="text" :class="classNames" :style="[badgeWidth, positionStyle, customStyle, dotStyle]"
class="uni-badge"
@click="onClick()">{{displayValue}}</text>
</view>
</template>
<script>
/**
* Badge 数字角标
* @description 数字角标一般和其它控件列表9宫格等配合使用用于进行数量提示默认为实心灰色背景
* @tutorial https://ext.dcloud.net.cn/plugin?id=21
* @property {String} text 角标内容
* @property {String} type = [default|primary|success|warning|error] 颜色类型
* @value default 灰色
* @value primary 蓝色
* @value success 绿色
* @value warning 黄色
* @value error 红色
* @property {String} size = [normal|small] Badge 大小
* @value normal 一般尺寸
* @value small 小尺寸
* @property {String} inverted = [true|false] 是否无需背景颜色
* @event {Function} click 点击 Badge 触发事件
* @example <uni-badge text="1"></uni-badge>
*/
export default {
name: 'UniBadge',
emits:['click'],
props: {
type: {
type: String,
default: 'default'
},
inverted: {
type: Boolean,
default: false
},
isDot: {
type: Boolean,
default: false
},
maxNum: {
type: Number,
default: 99
},
absolute: {
type: String,
default: ''
},
offset: {
type: Array,
default () {
return [0, 0]
}
},
text: {
type: [String, Number],
default: ''
},
size: {
type: String,
default: 'normal'
},
customStyle: {
type: Object,
default () {
return {}
}
}
},
data() {
return {};
},
computed: {
width() {
return String(this.text).length * 8 + 12
},
classNames() {
const {
inverted,
type,
size,
absolute
} = this
return [
inverted ? 'uni-badge--' + type + '-inverted' : '',
'uni-badge--' + type,
'uni-badge--' + size,
absolute ? 'uni-badge--absolute' : ''
].join(' ')
},
positionStyle() {
if (!this.absolute) return {}
let w = this.width / 2,
h = 10
if (this.isDot) {
w = 5
h = 5
}
const x = `${- w + this.offset[0]}px`
const y = `${- h + this.offset[1]}px`
const whiteList = {
rightTop: {
right: x,
top: y
},
rightBottom: {
right: x,
bottom: y
},
leftBottom: {
left: x,
bottom: y
},
leftTop: {
left: x,
top: y
}
}
const match = whiteList[this.absolute]
return match ? match : whiteList['rightTop']
},
badgeWidth() {
return {
width: `${this.width}px`
}
},
dotStyle() {
if (!this.isDot) return {}
return {
width: '10px',
height: '10px',
borderRadius: '10px'
}
},
displayValue() {
const { isDot, text, maxNum } = this
return isDot ? '' : (Number(text) > maxNum ? `${maxNum}+` : text)
}
},
methods: {
onClick() {
this.$emit('click');
}
}
};
</script>
<style lang="scss" scoped>
$bage-size: 12px;
$bage-small: scale(0.8);
$bage-height: 20px;
.uni-badge--x {
/* #ifdef APP-NVUE */
// align-self: flex-start;
/* #endif */
/* #ifndef APP-NVUE */
display: inline-block;
/* #endif */
position: relative;
}
.uni-badge--absolute {
position: absolute;
}
.uni-badge {
/* #ifndef APP-NVUE */
display: flex;
overflow: hidden;
box-sizing: border-box;
/* #endif */
justify-content: center;
flex-direction: row;
height: $bage-height;
line-height: $bage-height;
color: $uni-text-color;
border-radius: 100px;
background-color: $uni-bg-color-hover;
background-color: transparent;
text-align: center;
font-family: 'Helvetica Neue', Helvetica, sans-serif;
font-size: $bage-size;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-badge--inverted {
padding: 0 5px 0 0;
color: $uni-bg-color-hover;
}
.uni-badge--default {
color: $uni-text-color;
background-color: $uni-bg-color-hover;
}
.uni-badge--default-inverted {
color: $uni-text-color-grey;
background-color: transparent;
}
.uni-badge--primary {
color: $uni-text-color-inverse;
background-color: $uni-color-primary;
}
.uni-badge--primary-inverted {
color: $uni-color-primary;
background-color: transparent;
}
.uni-badge--success {
color: $uni-text-color-inverse;
background-color: $uni-color-success;
}
.uni-badge--success-inverted {
color: $uni-color-success;
background-color: transparent;
}
.uni-badge--warning {
color: $uni-text-color-inverse;
background-color: $uni-color-warning;
}
.uni-badge--warning-inverted {
color: $uni-color-warning;
background-color: transparent;
}
.uni-badge--error {
color: $uni-text-color-inverse;
background-color: $uni-color-error;
}
.uni-badge--error-inverted {
color: $uni-color-error;
background-color: transparent;
}
.uni-badge--small {
transform: $bage-small;
transform-origin: center center;
}
</style>

88
uni_modules/uni-badge/package.json

@ -0,0 +1,88 @@
{
"id": "uni-badge",
"displayName": "uni-badge 数字角标",
"version": "1.1.6",
"description": "数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。",
"keywords": [
"",
"badge",
"uni-ui",
"uniui",
"数字角标",
"徽章"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

58
uni_modules/uni-badge/readme.md

@ -0,0 +1,58 @@
## Badge 数字角标
> **组件名:uni-badge**
> 代码块: `uBadge`
数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
### 安装方式
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
如需通过`npm`方式使用`uni-ui`组件,另见文档:[https://ext.dcloud.net.cn/plugin?id=55](https://ext.dcloud.net.cn/plugin?id=55)
### 基本用法
在 ``template`` 中使用组件
```html
<uni-badge size="small" :text="100" absolute="rightBottom" type="primary">
<button type="default">右上</button>
</uni-badge>
<uni-badge text="1"></uni-badge>
<uni-badge text="2" type="purple" @click="bindClick"></uni-badge>
<uni-badge text="3" type="primary" :inverted="true"></uni-badge>
```
## API
### Badge Props
|属性名 |类型 |默认值 |说明 |
|:-: |:-: |:-: |:-: |
|text |String |- |角标内容 |
|type |String |default|颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
|size |String |normal |Badge 大小,可取值:normal、small |
|is-dot |Boolean|false |不展示数字,只有一个小点 |
|max-num |String/Numbuer|99 |展示封顶的数字值,超过 99 显示99+ |
|custom-style |Object | {} |自定义 Badge 样式, 样式对象语法 |
|inverted |Boolean|false |是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
|absolute (不支持 nvue) |String| rightTop|开启绝对定位, 角标将定位到其包裹的标签的四个角上,可选值: rightTop(右上角)、rightBottom(右下角)、leftBottom(左下角) 、leftTop(左上角) |
|offset |Array[number]| [0, 0]|距定位角中心点的偏移量,[-10, -10] 表示向 absolute 指定的方向偏移 10px,[10, 10] 表示向 absolute 指定的反方向偏移 10px,只有存在 absolute 属性时有效,与absolute 的值一一对应(例如:值为rightTop, 对应 offset 为 [right, Top])|
### Badge Events
|事件名 |事件说明 |返回参数 |
|:-: |:-: |:-: |
|@click |点击 Badge 触发事件| - |
## 组件示例
点击查看:[https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge](https://hellouniapp.dcloud.net.cn/pages/extUI/badge/badge)
Loading…
Cancel
Save