Commit 75fc03cf authored by 李星剑's avatar 李星剑

提交

parent 0d73bdbe
...@@ -54,6 +54,10 @@ export default { ...@@ -54,6 +54,10 @@ export default {
'unlisted':{ 'unlisted':{
url: `${baseUrl}/unlisted`, url: `${baseUrl}/unlisted`,
method: 'post' method: 'post'
},
'shPay':{
url: `${baseUrl}/shPay`,
method: 'post'
} }
} }
} }
...@@ -21,9 +21,18 @@ ...@@ -21,9 +21,18 @@
} }
}, },
{ {
"path": "pages/brands/brands", "path": "pages/user/login/login",
"style": { "style": {
"navigationBarTitleText": "品牌商首页", "navigationBarTitleText": "模拟登录",
"navigationBarTextStyle": "white",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
},
{
"path": "pages/webview/index",
"style": {
"navigationBarTitleText": "租户选择",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom", "navigationStyle": "custom",
...@@ -34,15 +43,22 @@ ...@@ -34,15 +43,22 @@
} }
} }
}, },
{ {
"path": "pages/user/login/login", "path": "pages/brands/brands",
"style": { "style": {
"navigationBarTitleText": "模拟登录", "navigationBarTitleText": "品牌商首页",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationStyle": "custom" "navigationStyle": "custom",
"mp-alipay": {
"transparentTitle": "always",
"titlePenetrate": "YES",
"allowsBounceVertical": "NO"
}
} }
}, },
{ {
"path": "pages/order/item", "path": "pages/order/item",
"style": { "style": {
......
...@@ -161,90 +161,9 @@ export default { ...@@ -161,90 +161,9 @@ export default {
}, },
methods: { methods: {
pay(){ pay(){
const jyAliPay = uni.requireNativePlugin('JY-ALIPAY') this.$Router.push({
uni.showToast({ path: '/pages/webview/index'
title: '开始',
complete(){
jyAliPay.show({ // 发起支付
if_sanbox:true,
auto_create_order_info:false,
appid:'',
rsa2_private:"",
order_info: {
"charset": "UTF-8",
"method": "alipay.trade.wap.pay",
"sign": "NWYSVaKc1hnFm1QL%2BLhUT4WdTglbyv94FeLlEa7%2BXYADec99w6F%2FvxgfTLXAd4%2BviDDuC4cdHOh7mtxDIJruqImXorRwls5DUa2u3nRPe%2BnbplJ8hbmPlqBZEJw1zWO5ND%2FXH4ANQw%2BBKQrhr6adghH0g%2BkxT2X%2Bs%2B%2FqDafHTwTx%2FeK4hbbcYzHQ%2FEnEaWCpj73R54y1PHE682WljKcPQlGZXcSatMWUxK48d79UI5gbcAQUQQ7gFoVuT9x4IXI8X5l5fnvNukD7d1RAv581p8xuvbt0hcXle%2BjvmvxiczGKb%2FTy5%2FQguj3dCYgzM25SG9RmlFkUrdT7ECwbNuA8Kw%3D%3D",
"return_url": "http%3A%2F%2F101.34.159.151%3A8329%2F",
"notify_url": "http%3A%2F%2F101.34.159.151%3A9001%2Fscs%2Fnotifies%2Fbackend",
"version": "1.0",
"app_id": "2021000118699056",
"sign_type": "RSA2",
"timestamp": "2022-01-18+16%3A51%3A31",
"alipay_sdk": "alipay-sdk-java-dynamicVersionNo",
"format": "json",
subject:"款式订单",
product_code:"QUICK_WAP_WAY",
out_trade_no:"ZQL1642495891908",
total_amount:0.01
}
}, function (result) {
if(result.resultStatus == '5002555')
{
uni.showToast({
title: '支付sdk出错'
})
}else if(result.resultStatus == '9000')
{
// that.vusui.msg('支付成功')
uni.showToast({
title: '支付成功'
})
}else{
// that.vusui.msg(result.memo)
uni.showToast({
title: result.memo
})
}
})// 支付完成回调
}
})
return;
uni.requestPayment({
provider: 'alipay',
orderInfo: {
"charset": "UTF-8",
"method": "alipay.trade.wap.pay",
"sign": "NWYSVaKc1hnFm1QL%2BLhUT4WdTglbyv94FeLlEa7%2BXYADec99w6F%2FvxgfTLXAd4%2BviDDuC4cdHOh7mtxDIJruqImXorRwls5DUa2u3nRPe%2BnbplJ8hbmPlqBZEJw1zWO5ND%2FXH4ANQw%2BBKQrhr6adghH0g%2BkxT2X%2Bs%2B%2FqDafHTwTx%2FeK4hbbcYzHQ%2FEnEaWCpj73R54y1PHE682WljKcPQlGZXcSatMWUxK48d79UI5gbcAQUQQ7gFoVuT9x4IXI8X5l5fnvNukD7d1RAv581p8xuvbt0hcXle%2BjvmvxiczGKb%2FTy5%2FQguj3dCYgzM25SG9RmlFkUrdT7ECwbNuA8Kw%3D%3D",
"return_url": "http%3A%2F%2F101.34.159.151%3A8329%2F",
"notify_url": "http%3A%2F%2F101.34.159.151%3A9001%2Fscs%2Fnotifies%2Fbackend",
"version": "1.0",
"app_id": "2021000118699056",
"sign_type": "RSA2",
"timestamp": "2022-01-18+16%3A51%3A31",
"alipay_sdk": "alipay-sdk-java-dynamicVersionNo",
"format": "json",
subject:"款式订单",
product_code:"QUICK_WAP_WAY",
out_trade_no:"ZQL1642495891908",
total_amount:0.01
}, //支付宝订单数据
success: res => {
uni.showToast({
title: 'success'
})
},
fail: err => {
// console.log('支付取消或者失败:', err);
// err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
uni.showToast({
title: 'requestPayment:fail cancel'
}) })
}
});
}, },
searchPotentialCustomers(){ searchPotentialCustomers(){
this.pageOptions = { this.pageOptions = {
......
...@@ -301,17 +301,17 @@ export default { ...@@ -301,17 +301,17 @@ export default {
required: true, required: true,
message: '请选择完成期限', message: '请选择完成期限',
}, },
clothWidth:{ clothWidth:[
max: 20, {
validate(rule, value, callback) { validator:(rule, value, callback) => {
let reg = new RegExp(/^([1-9][0-9]*)+(\\.[0-9]{1,2})?$/);
let reg = new RegExp(/^(\\d+)(.\\d{0,2})?$/);
return reg.test(value); return reg.test(value);
}, },
message: '门幅应保留小数点后两位', message: '门幅应保留小数点后两位',
// 可以单个或者同时写两个触发验证方式 // 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'], trigger: ['change','blur'],
}, },
]
}, },
// 暂存用的颜色组 // 暂存用的颜色组
modelingTaskColourDTOList: [], modelingTaskColourDTOList: [],
...@@ -528,7 +528,6 @@ export default { ...@@ -528,7 +528,6 @@ export default {
validate(callback){ validate(callback){
this.$refs['uForm'].validate((res) =>{ this.$refs['uForm'].validate((res) =>{
if (res) { if (res) {
return;
this.validateList(callback) this.validateList(callback)
} }
}) })
......
...@@ -260,6 +260,95 @@ ...@@ -260,6 +260,95 @@
</view> </view>
</view> </view>
</view> </view>
<u-form :model="detail" label-position="top" ref="uForm" style="display: none">
<view class="u-p-30 bg-fff u-m-b-20">
<hs-tip-title title="面料建模"></hs-tip-title>
<u-form-item label="面料名称" prop="materialName" required>
<u-input v-model="detail.materialName" placeholder="请输入面料名称" />
</u-form-item>
<u-form-item label="建模品类" prop="modelingCategoryText" required>
<u-input v-model="detail.modelingCategoryText"/>
</u-form-item>
<view class="brandList-tips u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" >
<view>
项目价格<text class="u-p-l-40">{{detail.price}}</text>
</view>
</view>
<u-form-item label="面料门幅" prop="clothWidth">
<u-number-box v-model="detail.clothWidth" :step="0.1" :positive-integer="false"></u-number-box>cm
</u-form-item>
<u-form-item label="面料成分" prop="component" required>
<u-input v-model="detail.component" placeholder="请输入面料成分" />
</u-form-item>
<u-form-item label="面料图片" prop="modelingTaskPictureDTOList" required>
<view class="wrap">
<view>
<view v-for="(item, index) in detail.modelingTaskPictureDTOList" :key="index" class="float-left ">
<view class="pre-item pre-item--80 u-relative" v-if="item.pictureCode" >
<image class="pre-item-image" :src="`${imgUrl}${item.pictureCode}`" mode="aspectFill"></image>
<text class="u-absolute pre-item-text text-center">{{ item.pictureType === 1 ? '正面': '反面'}}</text>
<view class="u-absolute pre-item-del">
<u-icon name="close" size="28" color="#fff"></u-icon>
</view>
</view>
<u-upload :custom-btn="true" :ref="`upload${index}`" :disabled="!!item.pictureCode"
width="160" height="160"
class="pre-item--80 float-left"
:show-upload-list="true" :max-count="1">
<view slot="addBtn" class=" slot-btn" hover-class="slot-btn__hover" hover-stay-time="150">
<u-icon name="plus" size="60" color="#c0c4cc"></u-icon>
</view>
</u-upload>
</view>
</view>
</view>
</u-form-item>
</view>
<!--委托建模信息-->
<view class="u-p-30 bg-fff u-m-b-20">
<hs-tip-title title="委托建模信息"></hs-tip-title>
<u-form-item label="完成期限" prop="expirationDate" required>
<u-input v-model="detail.expirationDate" :disabled="true"/>
</u-form-item>
<!--指定面料颜色数量-->
<u-form-item label="指定面料颜色数量" prop="component" required>
<u-number-box v-model="detail.clothRowColourQuantity"
:max="10"></u-number-box>
</u-form-item>
<view class="brandList-tips u-p-t-24 u-p-r-30 u-p-b-24 u-p-l-30" >
<view class="u-border-bottom u-flex u-p-b-18 ">
<view class="u-flex-1">
<view class="u-flex">
<view class="label u-flex-1">指定面料颜色名称</view>
<view class="value u-width-100" >
{{colorListNames}}
</view>
</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
<view class="u-border-bottom u-flex u-p-t-18 u-p-b-18">
<view class="label u-flex-1">设计机构提供颜色数量</view>
<view class="value">{{designAgencyColourQuantity}}</view>
</view>
<view class="u-border-bottom u-flex u-p-t-18 u-p-b-18">
<view class="u-flex-1">
<view class="u-flex">
<view class="label u-flex-1">设计机构提供颜色名称</view>
<view class="value u-width-100" >
{{taskColorNames}}
</view>
</view>
</view>
<u-icon name="arrow-right"></u-icon>
</view>
</view>
</view>
</u-form>
</view> </view>
<!--底部按钮--> <!--底部按钮-->
...@@ -267,6 +356,12 @@ ...@@ -267,6 +356,12 @@
<view class="footer" id="footer" > <view class="footer" id="footer" >
<view class="footer-btn"> <view class="footer-btn">
<view class="custom-style-round-circle custom-style-btn custom-style" v-if="detail.status === 1">
<view class="custom-style-left save" @click="toEdit(detail)">编辑</view>
<view class="custom-style-right submit" @click="toSubmit()">
<view class="title">立即发布</view>
</view>
</view>
<!----> <!---->
<view class="custom-style-round-circle custom-style-btn custom-style" v-if="detail.status === 4"> <view class="custom-style-round-circle custom-style-btn custom-style" v-if="detail.status === 4">
<view class="custom-style-right submit"> <view class="custom-style-right submit">
...@@ -332,7 +427,80 @@ export default { ...@@ -332,7 +427,80 @@ export default {
modelingTaskMaterialColourList: [], modelingTaskMaterialColourList: [],
modelingTaskLabelList: [] , // 建模任务的标签 modelingTaskLabelList: [] , // 建模任务的标签
}, },
// 表单验证逻辑
rules: {
materialName: [
{
required: true,
message: '请输入面料名称',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
{
max: 20,
message: '文字字数不能超过20字',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
{
// reg '^[a-zA-Z\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$',
// 自定义验证函数,见上说明
validator: (rule, value, callback) => {
// 上面有说,返回true表示校验通过,返回false表示不通过
// this.$u.test.mobile()就是返回true或者false的
let reg = new RegExp('^[\u4e00-\u9fa5][a-zA-Z0-9\u4e00-\u9fa5]*$')
return reg.test(value);
},
message: '请不要输入特殊符号',
trigger: ['change','blur'],
}
],
modelingCategoryText: [
{
required: true,
message: '请选择面料品类',
trigger: 'change'
}
],
component: [
{
required: true,
message: '请输入面料成分',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
{
max: 20,
message: '文字字数不能超过20字',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
],
modelingTaskPictureDTOList: {
validator: (rule,value) =>{
return value.filter((item) => {
return item.pictureCode
}).length === value.length
},
required: true,
message: '请输入上传图片',
},
expirationDate:{
required: true,
message: '请选择完成期限',
},
clothWidth:[
{
validator:(rule, value, callback) => {
let reg = new RegExp(/^([1-9][0-9]*)+(\\.[0-9]{1,2})?$/);
return reg.test(value);
},
message: '门幅应保留小数点后两位',
// 可以单个或者同时写两个触发验证方式
trigger: ['change','blur'],
},
]
},
imgUrl: this.$IMG_URL, // 上传地址 imgUrl: this.$IMG_URL, // 上传地址
formData: { formData: {
...@@ -362,6 +530,18 @@ export default { ...@@ -362,6 +530,18 @@ export default {
} }
}, },
computed:{ computed:{
activeColors(){
return this.detail.modelingTaskColourDTOList
.filter((item) => item.isDeleted === false)
},
colorListNames(){
return this.activeColors
.map((item) => item.colourName)
.filter(item => item)
.join("|")
},
labelNames(){ labelNames(){
return this.detail.modelingTaskLabelList return this.detail.modelingTaskLabelList
.filter(item => item.isDeleted === false) .filter(item => item.isDeleted === false)
...@@ -404,7 +584,7 @@ export default { ...@@ -404,7 +584,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.$refs.uForm.setRules(this.rules);
}, },
methods:{ methods:{
confirm(data){ confirm(data){
...@@ -412,6 +592,63 @@ export default { ...@@ -412,6 +592,63 @@ export default {
this.formData.courierText = label this.formData.courierText = label
this.formData.courier = value this.formData.courier = value
}, },
toSubmit(){
this.$refs['uForm'].validate((res) =>{
if (res) {
this.validateList(() =>{
this.submit(1)
})
}
})
},
submit(type){
let {modelingTaskPictureDTOList, ...onther} = this.detail;
this.$http("modeling.submit",Object.assign({},
onther,
{
designAgencyColourQuantity: this.designAgencyColourQuantity,
operationType:type,
modelingTaskPictureDTOList: modelingTaskPictureDTOList.concat(this.delModelingTaskPictureDTOList)})
).then(res =>{
let {
code,msg
} = res;
if(code === 200){
this.$refs.uToast.show({
title: msg,
back: true
});
}else{
this.$refs.uToast.show({
title: msg
});
}
})
},
validateList(callback){
// 指定面料颜色
let colorList = this.activeColors;
// 设计机构提供颜色
let colorPicList = this.activeTaskMaterialColour;
let checkColorPicList = colorPicList.filter((item) => !item.colorId).length === 0 && colorPicList.length === this.designAgencyColourQuantity;
let checkColorList = colorList.filter((item) => !item.colourName).length === 0;
if(checkColorPicList && checkColorList){
callback()
}else{
// this.$refs.uToast.show({
// title: '颜色不能为空'
// })
}
},
//toEdit
toEdit(item){
this.$Router.push({
path: '/pages/modeling/addItem',
query:{
id: item.id
}
})
},
// 寄样 // 寄样
sendSamples(){ sendSamples(){
this.$http("modeling.sendSamples",{ this.$http("modeling.sendSamples",{
......
<template>
<view ref="form" v-if="orderId">
<web-view :src="html" ></web-view>
</view>
</template>
<script>
export default {
name: "index",
data(){
return{
baseUrl: 'http://pay.huansi.net/#/payorder/',
orderId: '',
// html: 'http://pay.huansi.net/#/payorder/1483979726701785089'
}
},
computed:{
html(){
return `${this.baseUrl}${this.orderId}`
}
},
created() {
this.$http("stylelibraryorder.shPay").then(res => {
let {
success, result
} = res;
// console.log(res)
if(success){
this.orderId = result.orderId;
}
})
}
}
</script>
<style scoped>
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment