Browse Source

Merge branch 'devlop' of http://git.qniao.cn/qniao/paper-shopkeeper-H5 into devlop

devlop
邓雄飞 4 years ago
parent
commit
f639f6befc
7 changed files with 245 additions and 242 deletions
  1. 2
      App.vue
  2. 9
      apis/forComparisonApi.js
  3. 14
      apis/paperDetailsApi.js
  4. 26
      apis/storeApi.js
  5. 72
      pages/for-comparison/index.vue
  6. 87
      pages/paper-details/index.vue
  7. 277
      pages/store/index.vue

2
App.vue

@ -14,7 +14,7 @@ export default {
}
} else {
if (!store.state.supplierId) {
// go2('error')
go2('error')
}
}
},

9
apis/forComparisonApi.js

@ -0,0 +1,9 @@
import http from '../utils/http/index.js'
// 提交询价单
export function createEnquiryOrder(data) {
return http.post({
url: '/base-paper-trading/add/enquiry-order',
data
})
}

14
apis/paperDetailsApi.js

@ -0,0 +1,14 @@
import http from '../utils/http/index.js'
/**
* 获取店铺纸品详情
* @param {object} data 参数
* @returns {Promise<object[]>}
* swagger: http://api-ops-yyt-test.qniao.cn//base-paper-trading/swagger-ui/index.html?urls.primaryName=CustomerApi#/%E5%95%86%E5%93%81%E7%AE%A1%E7%90%86/getProductDetailForCustomerUsingGET
*/
export const getPaperDetail = (data = {}) => {
return http.get({
url: '/base-paper-trading/get/product-detail/for/customer',
data
})
}

26
apis/storeApi.js

@ -0,0 +1,26 @@
import http from '../utils/http/index.js'
/**
* 获取店铺信息
* @param {object} data 参数
* @returns {Promise<object[]>}
* swagger:http://api-ops-yyt-test.qniao.cn/base-paper-trading/swagger-ui/index.html?urls.primaryName=CustomerApi#/
*/
export const getCustomer = (data = {}) => {
return http.get({
url: '/base-paper-trading/get/store-detail/for/customer',
data
})
}
/**
* 获取店铺纸品列表
* @param {object} data 参数
* @returns {Promise<object[]>}
* swagger: http://api-ops-yyt-test.qniao.cn//base-paper-trading/swagger-ui/index.html?urls.primaryName=CustomerApi#/%E5%95%86%E5%93%81%E7%AE%A1%E7%90%86/getStoreProductListForCustomerUsingGET
*/
export const getPaperList = (data = {}) => {
return http.get({
url: '/base-paper-trading/get/store/product-list/for/customer',
data
})
}

72
pages/for-comparison/index.vue

@ -152,6 +152,7 @@ import qnDataPicker from '@/components/qn-data-picker/qn-data-picker.vue'
import qnDatetimePicker from '@/components/qn-datetime-picker/qn-datetime-picker.vue'
import qnFooter from '@/components/qn-footer/qn-footer.vue'
import uGap from '@/components/u-gap/u-gap.vue'
import { createEnquiryOrder } from '@/apis/forComparisonApi.js'
const validateFields = [
'name',
'uniformSocialCreditCode',
@ -222,48 +223,8 @@ export default {
},
methods: {
back,
showCompany(e) {
let enterpriseName = e.detail.value.trim()
if (enterpriseName) {
getCompanyList({ enterpriseName }).then(res => {
if (res) {
this.searchList = res.records
if (this.searchList.length > 0) {
this.$refs.popup.open('bottom')
}
}
})
}
},
selectCompany(enterpriseId) {
this.$refs.popup.close()
getCompanyInfoById({ enterpriseId }).then(res => {
if (res) {
this.form.id = enterpriseId
this.form.name = res.name
//
this.reflectiveCompany(res)
setTimeout(() => {
this.hasSelected = true
}, 0)
}
})
},
reflectiveCompany(info) {
this.form.uniformSocialCreditCode = info.uniformSocialCreditCode
this.form.locProvinceId = info.locProvinceId
this.form.locCityId = info.locCityId
this.form.locStreetId = info.locStreetId
this.form.locDistrictId = info.locDistrictId
this.form.locProvinceName = info.locProvinceName
this.form.locCityName = info.locCityName
this.form.locStreetName = info.locStreetName
this.form.locDistrictName = info.locDistrictName
this.form.locDetail = info.locDetail
this.form.registeredCapital = info.registeredCapital
this.form.foundDate = info.foundDate
},
onAreaChange(e) {
console.log('e', e)
if (e.detail.value && e.detail.value.length > 0) {
const [province, city, district, street] = e.detail.value
this.form.locProvinceId = province.value
@ -337,7 +298,7 @@ export default {
})
return
}
addCustomer(this.form).then(res => {
createEnquiryOrder(this.form).then(res => {
if (res) {
uni.showToast({
title: '添加成功',
@ -349,33 +310,8 @@ export default {
}
})
}
},
watch: {
['form.name'](val) {
if (this.hasSelected) {
console.log('watch:', val)
this.hasSelected = false
this.form.id = null
this.reflectiveCompany({})
}
}
},
computed: {
frontIDCard() {
let url = 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/frontIDCard.png'
if (this.hasSelected || !this.form.legalPersonIdCardFrontImg) {
return url
}
return this.form.legalPersonIdCardFrontImg
},
backIDCard() {
let url = 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/paper_shopkeeper/backDCard.png'
if (this.hasSelected || !this.form.legalPersonIdCardBackImg) {
return url
}
return this.form.legalPersonIdCardBackImg
}
}
}
</script>

87
pages/paper-details/index.vue

@ -1,10 +1,10 @@
<template>
<view class="warpper">
<view class="swiper-dot">
<uni-swiper-dot :info="info" :current="current" field="content" mode="indexes" style="height: 100%;">
<swiper class="swiper-box" @change="change" style="height: 100%;">
<swiper-item v-for="(item, index) in info" :key="index">
<view class=""><image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image></view>
<uni-swiper-dot :info="info.imgList" :current="current" field="content" mode="indexes" style="height: 100%;">
<swiper class="swiper-box" @change="swiperChange" style="height: 100%;">
<swiper-item v-for="(item, index) in info.imgList" :key="index">
<view class="" @tap="previewImg(item, info.imgList)"><image class="image" :src="item || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif'" mode=""></image></view>
</swiper-item>
</swiper>
</uni-swiper-dot>
@ -13,15 +13,15 @@
<view class="info-box">
<view class="info">
<view class="price-row">
<text class="price">¥2300</text>
<text class="unit">/</text>
<text class="price">¥{{info.skuList[0].listPrice}}</text>
<text class="unit">/{{info.skuList[0].stockUnit}}</text>
</view>
<view class="row">
<view class="name">
博汇朱雀白卡
{{ info.name }}
</view>
<view class="value">
库存9600
库存{{info.skuList[0].stock || XX}}{{info.skuList[0].stockUnit}}
</view>
</view>
</view>
@ -29,17 +29,20 @@
<view class="label">
克重
</view>
<view class="tag-box" v-for="(titme, tindex) in 4" :key="tindex">
<text>240g</text>
<view class="tag-box" v-for="(titem, tindex) in info.skuList" :key="tindex">
<text>{{titem.weight}}g</text>
</view>
</view>
<view class="list-box">
<view class="label" style="font-size: 24rpx;">
规格
</view>
<view class="tag-box" v-for="(titme, tindex) in 2" :key="tindex">
<view class="tag-box">
<text>787*1092</text>
</view>
<view class="tag-box">
<text>899*1194</text>
</view>
</view>
</view>
<uGap></uGap>
@ -48,7 +51,7 @@
商品卖点
</view>
<view class="desc">
月结30天价格不加服务费
{{info.sellingProposition}}
</view>
</view>
<view class="other">
@ -56,7 +59,7 @@
商品描述
</view>
<view class="desc">
售价全部为含税价支持先用后付欢迎来电查询近期价格波动较大请下单前先咨询价格
{{info.description}}
</view>
</view>
<view class="other">
@ -64,7 +67,7 @@
送货说明
</view>
<view class="desc">
分切纸不足重量的另加调机费低于送货重量或超出送货范围的运费另计
{{info.shippingNote}}
</view>
</view>
<view class="other" style="border: none;">
@ -72,7 +75,7 @@
其他说明
</view>
<view class="desc">
无其他说明
{{info.otherNote}}
</view>
</view>
<qn-footer fixed height="100rpx">
@ -80,13 +83,13 @@
<view class="left">
<view class="">
<image class="icon" src="/static/imgs/paperDetails/shop-icon.png"></image>
<view class="label">
<view class="label" @tap="storeTap">
店铺
</view>
</view>
<view class="">
<image class="icon" src="/static/imgs/paperDetails/shopping-trolley.png"></image>
<view class="label">
<view class="label" @tap="shoppingCartTap">
购物车
</view>
</view>
@ -193,31 +196,45 @@ import uGap from '@/components/u-gap/u-gap.vue'
import qnFooter from '@/components/qn-footer/qn-footer.vue'
import qnInputNumber from '@/components/qn-input-number/qn-input-number.vue'
import { go2 } from '@/utils/hook.js'
import { getPaperDetail } from '@/apis/paperDetailsApi.js'
export default {
components: { uGap, qnFooter, qnInputNumber },
data() {
return {
info: [
{
content: '内容 A'
},
{
content: '内容 B'
},
{
content: '内容 C'
}
],
current: 0,
weightList: ['240', '250', '280'],
specificationList: ['正度', '大度', '特规分切'],
kgActive: 0,
ggActive: 0,
value: null,
params: {
productId: '',
},
info: {}
}
},
onLoad(option) {
this.params.productId = option.id
this.queryData()
},
methods:{
//
queryData() {
getPaperDetail(this.params).then(res => {
console.log('店铺纸品详情', res)
if(res) {
this.info = res
}
})
},
//
storeTap() {
go2('store')
},
//
shoppingCartTap() {
go2('cart')
},
addShoppingTap() {
this.$refs.popup.open('bottom')
},
@ -246,7 +263,17 @@ export default {
//
confirm() {
this.$refs.popup.close()
}
},
//
swiperChange(e) {
this.current = e.detail.current;
},
previewImg(index, list) {
uni.previewImage({
urls: list,
current: index
});
},
}
}
</script>

277
pages/store/index.vue

@ -5,168 +5,156 @@
<view class=""></view>
</qnHeader>
<view class="top-box">
<view class=""><image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image></view>
<view class="">
<!-- <image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image> -->
<image class="image" :src="customerInfo.logo || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif'" mode=""></image>
</view>
<view class="center">
<view class="title">东莞市隆兴纸业有限公司</view>
<view class="desc">全部商品 39 &nbsp; | &nbsp;上新 9</view>
<view class="title">{{ customerInfo.name }}</view>
<view class="desc">全部商品 {{ customerInfo.productNumber }} &nbsp; | &nbsp;上新 {{ customerInfo.currentProductNumber }}</view>
</view>
</view>
<view class="search-box">
<uni-easyinput
v-model="enterpriseName"
:inputBorder="false"
:clearSize="18"
:placeholderStyle="'font-size:25rpx;text-align: center;font-weight: 400;color: rgba(34,34,34,0.75);'"
placeholder="搜索"
confirmType="search"
type="text"
class="easyinput"
v-model="enterpriseName"
:inputBorder="false"
:clearSize="18"
:placeholderStyle="'font-size:25rpx;text-align: center;font-weight: 400;color: rgba(34,34,34,0.75);'"
placeholder="搜索"
confirmType="search"
type="text"
class="easyinput"
prefixIcon="search"
@input="search"
@confirm="addHistory"
@confirm="searchConfirm"
/>
</view>
<scroll-list ref="list" :option="option" @load="upCallback" @refresh="downCallback" style="background-color: #FFFFFF;">
<view class="content" >
<view class="box" v-for="(item, index) in 7" :key="index">
<view class="content">
<view class="box" v-for="(item, index) in list" :key="index">
<view class="image-box">
<view class="">
<image class="special-img" src="/static/imgs/store/special-offe.png" mode=""></image>
</view>
<image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image>
</view>
<view class="title">
博汇朱雀白卡
<view class=""><image class="special-img" :src="item.isPromoting ? '/static/imgs/store/special-offe.png' : ''" mode=""></image></view>
<image class="image" :src="item.litPicUrl || 'https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif'" mode=""></image>
</view>
<view class="title">{{ item.name }}</view>
<view class="desc">
<view class="">
<image class="icon" src="/static/imgs/store/address-icon.png"></image>
<text style="padding-left: 6rpx;">广州市</text>
</view>
<view class="">
库存:9600
<text style="padding-left: 6rpx;">{{ customerInfo.area }}</text>
</view>
<view class="">库存:{{ item.stock || XX }} {{ item.stockUnit == 1 ? '张' : '吨' }}</view>
</view>
<view class="footer">
<view class="">
<text class="price">¥2300</text>
<text class="unit">/</text>
</view>
<view class="btn" @tap="seeDetailsTap(item)">
马上抢
<view class="left">
<text class="price">{{ item.priceRange }}</text>
<!-- <text class="unit">/</text> -->
</view>
<view class="btn" @tap="seeDetailsTap(item)">马上抢</view>
</view>
</view>
<!-- <view class="box">
<view class="image-box">
<view class="">
<image class="special-img" src="/static/imgs/store/special-offe.png" mode=""></image>
</view>
<image class="image" src="https://qncloud.oss-cn-shenzhen.aliyuncs.com/ztb_pic/testPic.jfif" mode=""></image>
</view>
<view class="title">
博汇朱雀白卡
</view>
<view class="desc">
<view class="">
<image class="icon" src="/static/imgs/store/address-icon.png"></image>
<text style="padding-left: 6rpx;">广州市</text>
</view>
<view class="">
库存:9600
</view>
</view>
<view class="footer">
<view class="">
<text class="price">¥2300</text>
<text class="unit">/</text>
</view>
<view class="btn">
马上抢
</view>
</view>
</view> -->
</view>
</scroll-list>
</view>
</template>
<script>
import qnHeader from '@/components/qn-header/qn-header.vue'
import { go2 } from '@/utils/hook.js'
export default {
components: {qnHeader},
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
params: {},
pagination: {
pageNum: 0, //
pageSize: 10
},
enterpriseName: '',
list: [],
}
},
methods: {
seeDetailsTap(item) {
go2('paper-details', {id: null})
import qnHeader from '@/components/qn-header/qn-header.vue'
import { go2 } from '@/utils/hook.js'
import { getCustomer, getPaperList } from '@/apis/storeApi.js'
export default {
components: { qnHeader },
data() {
return {
option: {
size: 10,
auto: true,
emptyText: '暂无数据~',
background: '#F7F8FA',
disabled: false
},
getList() {
// return new Promise((resolve, reject) => {
// getDeviceInfo({ ...this.params, ...this.pagination })
// .then(res => {
// res.records.forEach(el => {
// el.collapse = false
// el.isShowSelect = false
// })
// if (res) {
// if (this.pagination.pageNum == 1) {
// this.list = res.records
// } else {
// this.list = this.list.concat(res.records)
// }
// // this.list = []
// // this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
// resolve({ list: this.list, total: res.total })
// }
// })
// .catch(err => {
// reject(err)
// })
// })
params: {
asc: '',
desc: '',
name: '',
name: '',
supplierId: this.$store.state.supplierId || null
},
downCallback() {
// this.pagination.pageNum = 1
// this.getList()
// .then(({ list, total }) => {
// this.$refs.list.refreshSuccess({ list, total })
// })
// .catch(() => {
// this.$refs.list.refreshFail()
// })
pagination: {
pageNum: 0, //
pageSize: 10
},
upCallback() {
// this.pagination.pageNum++
// this.getList()
// .then(({ list, total }) => {
// this.$refs.list.loadSuccess({ list, total })
// })
// .catch(() => {
// this.$refs.list.loadFail()
// })
enterpriseName: '',
list: [],
customerParams: {
supplierId: this.$store.state.supplierId || null
// supplierId: '677166944742412288'
},
search() {},
addHistory(value) {}
customerInfo: {}
}
},
onLoad() {
this.getCustomer()
},
methods: {
seeDetailsTap(item) {
go2('paper-details', { id: item.id })
},
//
getCustomer() {
getCustomer(this.customerParams).then(res => {
// console.log('', res)
if (res) {
this.customerInfo = res
}
})
},
getList() {
return new Promise((resolve, reject) => {
getPaperList({ ...this.params, ...this.pagination })
.then(res => {
console.log('纸品列表', res)
if (res) {
if (this.pagination.pageNum == 1) {
this.list = res.records
} else {
this.list = this.list.concat(res.records)
}
// this.list = []
// this.list = [...this.list, ...[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]
resolve({ list: this.list, total: res.total })
}
})
.catch(err => {
reject(err)
})
})
},
downCallback() {
this.pagination.pageNum = 1
this.getList()
.then(({ list, total }) => {
this.$refs.list.refreshSuccess({ list, total })
})
.catch(() => {
this.$refs.list.refreshFail()
})
},
upCallback() {
this.pagination.pageNum++
this.getList()
.then(({ list, total }) => {
this.$refs.list.loadSuccess({ list, total })
})
.catch(() => {
this.$refs.list.loadFail()
})
},
searchConfirm(value) {
this.params.name = value
this.pagination.pageNum = 1
this.getList()
}
}
}
</script>
<style lang="scss">
@ -180,7 +168,7 @@
text-align: center;
font-weight: 500;
}
.right-title {
font-size: 28rpx;
color: #007aff;
@ -205,7 +193,6 @@
}
.right {
width: 140rpx;
}
.center {
padding-left: 20rpx;
@ -225,7 +212,6 @@
font-weight: 500;
padding-right: 32rpx;
padding-top: 12rpx;
}
.cut {
display: flex;
@ -258,10 +244,10 @@
justify-content: center;
padding: 0rpx 32rpx;
height: 104rpx;
background: #FFFFFF;
background: #ffffff;
.easyinput {
height: 72rpx;
background: #F5F6F7;
background: #f5f6f7;
border-radius: 16rpx;
}
}
@ -273,15 +259,15 @@
padding: 0rpx 32rpx 20rpx 32rpx;
.box {
// height: 514rpx;
background: #FFFFFF;
box-shadow: 0rpx 8rpx 28rpx 0rpx rgba(112,112,112,0.1);
width: 330rpx;
background: #ffffff;
box-shadow: 0rpx 8rpx 28rpx 0rpx rgba(112, 112, 112, 0.1);
border-radius: 10rpx;
.special-img {
width: 110rpx;
height: 110rpx;
position: absolute;
z-index: 10;
}
.image {
width: 330rpx;
@ -296,7 +282,6 @@
letter-spacing: 0;
font-weight: 500;
padding-top: 10rpx;
}
.desc {
display: flex;
@ -319,30 +304,36 @@
justify-content: space-between;
align-items: center;
padding: 10rpx 16rpx 37rpx 16rpx;
.left {
flex-grow: 1;
flex-shrink: 1;
}
.price {
font-size: 34rpx;
color: #F5222D;
color: #f5222d;
letter-spacing: 0;
font-weight: 600;
}
.unit {
font-size: 24rpx;
color: #F5222D;
color: #f5222d;
letter-spacing: 0;
text-align: left;
font-weight: 400;
}
.btn {
flex-grow: 0;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
// text-align: center;
width: 108rpx;
height: 48rpx;
background: #FF4849;
background: #ff4849;
border-radius: 27rpx;
ont-size: 26rpx;
color: #FFFFFF;
color: #ffffff;
letter-spacing: 0;
font-weight: 400;
}

Loading…
Cancel
Save