图片处理

master
lion 3 months ago
parent 32053108f7
commit fc9c22e27f

@ -4,11 +4,10 @@ export const appConfig = {
// baseUrl: 'http://yunyubang.localhost.com', // baseUrl: 'http://yunyubang.localhost.com',
baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦 baseUrl:'https://yunyubang.ali251.langye.net',// 'https://yunyubang2021.langye.net', //孕育邦
// baseUrl: 'https://yybtest.ali251.langye.net', // baseUrl: 'http://yunyubang-test.ali251.langye.net',
newBaseUrl: 'https://yunyubang.ali251.langye.net', newBaseUrl: 'https://yunyubang.ali251.langye.net',
// newBaseUrl: 'http://yybtest.ali251.langye.net', // newBaseUrl: 'http://yunyubang-test.ali251.langye.net',
//baseUrl:'https://yybtest2021.langye.net',//孕育咨询
openidInfoKey: 'openid_info_yunyubang' openidInfoKey: 'openid_info_yunyubang'
} }

@ -4,10 +4,10 @@
<image class="banner" :src="info.poster"></image> <image class="banner" :src="info.poster"></image>
</view> </view>
<view class="toptitle"> <view class="toptitle">
<view class="h3">{{info.name}}</view> <view class="h3">{{info.name}}</view>
<view class='price'> <view class='price'>
<text class="font_red" v-if="info.price > 0">{{info.price}}</text> <text class="font_red" v-if="info.price > 0">{{info.price}}</text>
<text class="free" v-else></text> <text class="free" v-else></text>
</view> </view>
<view class="dataGroup"> <view class="dataGroup">
<view class="dataCol"> <view class="dataCol">
@ -38,7 +38,7 @@
<view class="add_l">暂无</view> <view class="add_l">暂无</view>
<view class="add_r" @click=""> <view class="add_r" @click="">
<text class="iconfont icon-dianhua"></text> <text class="iconfont icon-dianhua"></text>
<text @click="calltel"><text style="color:#bf617c">{{tel}}</text> <text @click="calltel"><text style="color:#bf617c">{{tel}}</text>
</text> </text>
</view> </view>
</view> </view>
@ -52,10 +52,10 @@
<view class="date-txt" v-if="false"> 09:00-18:00</view> <view class="date-txt" v-if="false"> 09:00-18:00</view>
<view class="add_r starts" @click=""> <view class="add_r starts" @click="">
<text class="iconfont icon-dianhua"></text> <text class="iconfont icon-dianhua"></text>
<text @click="calltel"><text style="color:#bf617c">{{tel}}</text> <text @click="calltel"><text style="color:#bf617c">{{tel}}</text>
</text> </text>
</view> </view>
<view class="txt">{{info.merchant.address}}</view> <view class="txt">{{info.merchant.address}}</view>
</view> </view>
</view> </view>
@ -119,17 +119,17 @@
<text class="iconfont icon-Icon_customerservice"></text> <text class="iconfont icon-Icon_customerservice"></text>
<text>客服</text> <text>客服</text>
</button> </button>
</view> </view>
<block v-if="info.can_buy===1"> <block v-if="info.can_buy===1">
<view class="buyBtn" v-if="info.state=='active'" @click="toBuy">{{buyName}}</view> <view class="buyBtn" v-if="info.state=='active'" @click="toBuy">{{buyName}}</view>
<view class="buyBtn buyNoBtn" v-else>{{buyName}}</view> <view class="buyBtn buyNoBtn" v-else>{{buyName}}</view>
</block> </block>
</view> </view>
<u-popup v-model="showPop" mode="bottom" closeable="true"> <u-popup v-model="showPop" mode="bottom" closeable="true">
<view class="buyBox"> <view class="buyBox">
<view class="title">请输入您的联系方式</view> <view class="title">请输入您的联系方式</view>
<scroll-view scroll-y="true" style="height: 700rpx;padding-bottom: 40rpx;"> <scroll-view scroll-y="true" style="height: 700rpx;padding-bottom: 40rpx;">
<view class="formCol"> <view class="formCol">
<view>宝妈姓名<text style="color:red">*</text></view> <view>宝妈姓名<text style="color:red">*</text></view>
@ -146,25 +146,25 @@
<view class="uni-input">{{form.due_date}}</view> <view class="uni-input">{{form.due_date}}</view>
</picker> </picker>
</view> </view>
</view> </view>
<view class="formCol" v-if="modelList.length>1"> <view class="formCol" v-if="modelList.length>1">
<view>产品型号<text style="color:red">*</text></view> <view>产品型号<text style="color:red">*</text></view>
<view class="formRight"> <view class="formRight">
<picker :value="mindex" @change="bindModelChange" :range="modelList"> <picker :value="mindex" @change="bindModelChange" :range="modelList">
<view class="uni-input">{{modelList[mindex]}}</view> <view class="uni-input">{{modelList[mindex]}}</view>
</picker> </picker>
</view> </view>
</view> </view>
<view class="formCol"> <view class="formCol">
<view>所属区域<text style="color:red">*</text></view> <view>所属区域<text style="color:red">*</text></view>
<view class="formRight"> <view class="formRight">
<picker :value="rindex" @change="bindRegionChange" :range="arrRegion"> <picker :value="rindex" @change="bindRegionChange" :range="arrRegion">
<view class="uni-input">{{arrRegion[rindex]}}</view> <view class="uni-input">{{arrRegion[rindex]}}</view>
</picker> </picker>
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<text v-if="info.product_type.name==='实物' && rindex!=0" style="color:red">*</text> <text v-if="info.product_type.name==='实物' && rindex!=0" style="color:red">*</text>
<input type="text" :required="info.product_type.name==='实物'?true:false" v-if="rindex!=0" v-model="form.address" style="margin-top: 10rpx;" <input type="text" :required="info.product_type.name==='实物'?true:false" v-if="rindex!=0" v-model="form.address" style="margin-top: 10rpx;"
placeholder="请输入具体街道/地址"> placeholder="请输入具体街道/地址">
</view> </view>
</view> </view>
</view> </view>
@ -259,11 +259,11 @@
id: "", id: "",
tel: "18550406975", tel: "18550406975",
showPass: false, showPass: false,
info: {}, info: {},
viewCounts:'', viewCounts:'',
dataList: [], dataList: [],
buyName:'', buyName:'',
mindex:0, mindex:0,
modelList:['请选择产品型号'], modelList:['请选择产品型号'],
form: { form: {
product_type: "product", product_type: "product",
@ -272,7 +272,7 @@
phone: '', phone: '',
member_name: "", member_name: "",
member_comment: "", member_comment: "",
promotion: "", promotion: "",
model_name:'', model_name:'',
region: '', region: '',
address: '', address: '',
@ -333,7 +333,7 @@
that.form.member_name = info.user_info.wechat_nickname; that.form.member_name = info.user_info.wechat_nickname;
} }
that.loadInfo(); that.loadInfo();
that.loadPage(); that.loadPage();
that.getHospital() that.getHospital()
that.getArea() that.getArea()
@ -364,47 +364,58 @@
}, },
methods: { methods: {
// //
jumpToWeChatCustomerService() { processContentImages: function(content) {
this.openWeChatCustomerService("https://work.weixin.qq.com/kfid/kfccc6609d51a87324d?enc_scene=ENC5n1b6XBY2paqReUMjwNmTGay8jwTZQuyn17jL8n5xK9T7ZwfJx36T5EHqVbFWTzP8s", "wwe480a61872b54394"); if (!content || typeof content !== 'string') {
}, return content;
}
// ../storage/files/
// content = content.replace(/(["'=:])(\.\.\/storage\/files\/)([^"'\s<>]+)/g, `$1${this.baseUrl}/storage/files/$3`);
openWeChatCustomerService ( // /storage/files/
weiXinCustomerServiceUrl = "", content = content.replace(/(["'=:])(\/storage\/files\/)([^"'\s<>]+)/g, `$1${this.baseUrl}/storage/files/$3`);
corpId = "", return content;
showMessageCard = false, },
sendMessageTitle = "", //
sendMessagePath = "", jumpToWeChatCustomerService() {
sendMessageImg = "" this.openWeChatCustomerService("https://work.weixin.qq.com/kfid/kfccc6609d51a87324d?enc_scene=ENC5n1b6XBY2paqReUMjwNmTGay8jwTZQuyn17jL8n5xK9T7ZwfJx36T5EHqVbFWTzP8s", "wwe480a61872b54394");
) { },
if (!weiXinCustomerServiceUrl || !corpId)
return Toast("请配置好客服链接或者企业ID");
// eslint-disable-next-line no-undef //
wx.openCustomerServiceChat({ openWeChatCustomerService (
// weiXinCustomerServiceUrl = "",
extInfo: { corpId = "",
url: weiXinCustomerServiceUrl, // https://work.weixin.qq.com/xxxxxxxx showMessageCard = false,
}, sendMessageTitle = "",
corpId, // ID wwed1ca4d3597eXXXX sendMessagePath = "",
showMessageCard, // sendMessageImg = ""
sendMessageTitle, // ) {
sendMessagePath, // .htmlpages/index/index.html if (!weiXinCustomerServiceUrl || !corpId)
sendMessageImg, // return Toast("请配置好客服链接或者企业ID");
success(res) { // eslint-disable-next-line no-undef
console.log("success", JSON.stringify(res)); wx.openCustomerServiceChat({
}, //
fail(err) { extInfo: {
console.log("fail", JSON.stringify(err)); url: weiXinCustomerServiceUrl, // https://work.weixin.qq.com/xxxxxxxx
// eslint-disable-next-line no-undef },
return wx.showToast({ corpId, // ID wwed1ca4d3597eXXXX
title: err.errMsg, showMessageCard, //
icon: "none" sendMessageTitle, //
}); sendMessagePath, // .htmlpages/index/index.html
}, sendMessageImg, //
}); success(res) {
console.log("success", JSON.stringify(res));
},
fail(err) {
console.log("fail", JSON.stringify(err));
// eslint-disable-next-line no-undef
return wx.showToast({
title: err.errMsg,
icon: "none"
});
},
});
}, },
calltel(phone) { calltel(phone) {
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
@ -512,7 +523,7 @@
}) })
}) })
} }
}, },
bindModelChange:function(e) { bindModelChange:function(e) {
this.mindex = e.target.value; this.mindex = e.target.value;
this.form.model_name = this.modelList[e.target.value]; this.form.model_name = this.modelList[e.target.value];
@ -526,42 +537,42 @@
if (this.arrHospital[e.target.value] != '其他') { if (this.arrHospital[e.target.value] != '其他') {
this.form.hospital = this.arrHospital[e.target.value]; this.form.hospital = this.arrHospital[e.target.value];
} }
},
async getArea(code) {
await weixin.request({
newUrl: true,
api: '/api/member/parameter/show',
data: {
number: 'area'
},
utilSuccess: (res) => {
this.arrRegion = []
this.arrRegion.push("请选择区域")
res.detail.map(item => {
this.arrRegion.push(item.value)
})
}
})
}, },
async getHospital(code) { async getArea(code) {
await weixin.request({ await weixin.request({
newUrl: true, newUrl: true,
api: '/api/member/parameter/show', api: '/api/member/parameter/show',
data: { data: {
number: 'hospital' number: 'area'
}, },
utilSuccess: (res) => { utilSuccess: (res) => {
this.arrHospital = [] this.arrRegion = []
this.arrHospital.push("请选择建卡医院") this.arrRegion.push("请选择区域")
res.detail.map(item => { res.detail.map(item => {
this.arrHospital.push(item.value) this.arrRegion.push(item.value)
}) })
} }
}) })
},
async getHospital(code) {
await weixin.request({
newUrl: true,
api: '/api/member/parameter/show',
data: {
number: 'hospital'
},
utilSuccess: (res) => {
this.arrHospital = []
this.arrHospital.push("请选择建卡医院")
res.detail.map(item => {
this.arrHospital.push(item.value)
})
}
})
}, },
getPoster: function() { getPoster: function() {
var that = this; var that = this;
@ -601,7 +612,7 @@
this.$refs.shareCode.open(); this.$refs.shareCode.open();
this.getPoster(); this.getPoster();
}, },
draw: function() { draw: function() {
var that = this; var that = this;
uni.request({ uni.request({
@ -814,23 +825,23 @@
return false; return false;
} }
if (this.modelList.length>1 && (this.form.model_name == "请选择产品型号" || weixin.isNull(this.form.model_name))) { if (this.modelList.length>1 && (this.form.model_name == "请选择产品型号" || weixin.isNull(this.form.model_name))) {
this.alert('请选择产品型号') this.alert('请选择产品型号')
return return
} }
if (this.form.region == "请选择区域" || weixin.isNull(this.form.region)) { if (this.form.region == "请选择区域" || weixin.isNull(this.form.region)) {
this.alert('请选择区域') this.alert('请选择区域')
return return
} }
if(this.info.product_type.name==='实物' && weixin.isNull(this.form.address)){ if(this.info.product_type.name==='实物' && weixin.isNull(this.form.address)){
this.alert('请填写具体地址') this.alert('请填写具体地址')
return return
} }
if (this.form.hospital == "请选择建卡医院") { if (this.form.hospital == "请选择建卡医院") {
this.alert('请选择建卡医院') this.alert('请选择建卡医院')
return return
} }
// console.log(this.form) // console.log(this.form)
// return // return
// jsuni.$u.throttle() // jsuni.$u.throttle()
uni.$u.throttle(this.toDoBuy, 1000); uni.$u.throttle(this.toDoBuy, 1000);
@ -923,8 +934,8 @@
url: "../shopDetail/shopDetail?id=" + id url: "../shopDetail/shopDetail?id=" + id
}) })
}, },
loadInfo: function() { loadInfo: function() {
this.loadView(); this.loadView();
let that = this let that = this
weixin.request({ weixin.request({
api: '/api/member/get-product/' + this.id, api: '/api/member/get-product/' + this.id,
@ -933,15 +944,20 @@
//r.data.poster = this.baseUrl + r.data.poster; //r.data.poster = this.baseUrl + r.data.poster;
that.info = r.data; that.info = r.data;
that.info.poster = (weixin.isNull(that.info.poster) ? "../../static/750x500.jpg" : that.info.poster = (weixin.isNull(that.info.poster) ? "../../static/750x500.jpg" :
that.info.poster_url) that.info.poster_url)
that.buyName = that.info.state=='active'?'立即购买':'已下架' that.buyName = that.info.state=='active'?'立即购买':'已下架'
let _marr = r.data.model?JSON.parse(r.data.model):[] //
if(_marr.length>0){ if (that.info.content) {
_marr.map(item=>{ that.info.content = that.processContentImages(that.info.content);
that.modelList.push(item.name) }
})
let _marr = r.data.model?JSON.parse(r.data.model):[]
if(_marr.length>0){
_marr.map(item=>{
that.modelList.push(item.name)
})
} }
}, },
utilFail: r => { utilFail: r => {
@ -957,8 +973,8 @@
customLoading: false, customLoading: false,
data: { data: {
page: 1, page: 1,
page_size: 3, page_size: 3,
sort_name:'sortnumber', sort_name:'sortnumber',
sort_type:"ASC" sort_type:"ASC"
}, },
utilSuccess: function(r) { utilSuccess: function(r) {
@ -979,35 +995,35 @@
util.alert(res); util.alert(res);
} }
}); });
}, },
loadView: function() { loadView: function() {
var that = this; var that = this;
weixin.request({ weixin.request({
bindThis: that, bindThis: that,
api: '/api/member/other/pv-count', api: '/api/member/other/pv-count',
customLoading: false, customLoading: false,
data: { data: {
url:'/api/member/get-product/' + that.id url:'/api/member/get-product/' + that.id
}, },
utilSuccess: function(r) { utilSuccess: function(r) {
console.log("r",r) console.log("r",r)
that.viewCounts = r.total that.viewCounts = r.total
}, },
utilFail: function(res) { utilFail: function(res) {
util.alert(res); util.alert(res);
} }
}); });
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
/deep/ .parseHtml video { /deep/ .parseHtml video {
width: 80% !important; width: 80% !important;
min-height: 150px !important; min-height: 150px !important;
margin: 20px auto; margin: 20px auto;
height:auto!important; height:auto!important;
display: block; display: block;
} }
</style> </style>
@ -1134,9 +1150,9 @@
text-align: center; text-align: center;
line-height: 72rpx; line-height: 72rpx;
color: #fff; color: #fff;
} }
.buyNoBtn{ .buyNoBtn{
background: linear-gradient(90deg, #ddd 0%, #ddd 100%); background: linear-gradient(90deg, #ddd 0%, #ddd 100%);
} }
} }
@ -1221,7 +1237,7 @@
.banner { .banner {
display: block; display: block;
width: 100%; width: 100%;
height: 535rpx; height: 535rpx;
// height: 500rpx; // height: 500rpx;
} }
@ -1314,7 +1330,7 @@
.discuss { .discuss {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
margin: 25rpx 0; margin: 25rpx 0;
margin-bottom:0; margin-bottom:0;
position: relative; position: relative;
align-items: center; align-items: center;
@ -1355,7 +1371,7 @@
display: inline-block; display: inline-block;
font-size: 36rpx; font-size: 36rpx;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
width:90%; width:90%;
} }
@ -1547,8 +1563,8 @@
margin-left: 24rpx; margin-left: 24rpx;
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
view{ view{
margin-bottom:10rpx margin-bottom:10rpx
} }
.name { .name {
font-size: 32rpx; font-size: 32rpx;
@ -1568,7 +1584,7 @@
display: inline-block; display: inline-block;
margin-right: 7rpx; margin-right: 7rpx;
height: 100%; height: 100%;
line-height: 20rpx; line-height: 20rpx;
vertical-align: middle; vertical-align: middle;
} }
} }
@ -1631,14 +1647,14 @@
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
line-height: 45rpx; line-height: 45rpx;
} }
} }
image { image {
width: 100%; width: 100%;
margin-top: 30rpx; margin-top: 30rpx;
} }
} }
@ -1900,4 +1916,4 @@
color: #666; color: #666;
} }
} }
</style> </style>

Loading…
Cancel
Save