Commit 7eb33ce8 by 李嘉林

上传图片

parent 6cbd1d67
...@@ -17,6 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl ...@@ -17,6 +17,7 @@ module.exports = merge(prodEnv, {//zjgyl
// BASE_URL:"'http://192.168.1.146:3005'", // BASE_URL:"'http://192.168.1.146:3005'",
// BASE_URL:"'http://192.168.1.127:3000'", // BASE_URL:"'http://192.168.1.127:3000'",
BASE_URL:"'https://test-m-shop.mayi888.cn'", BASE_URL:"'https://test-m-shop.mayi888.cn'",
ADMIN_URL:"'https://test-ant.mayi888.cn'",
// BASE_URL:"'http://192.168.137.1:3004'", // BASE_URL:"'http://192.168.137.1:3004'",
OLSHOP_URL:'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"', OLSHOP_URL:'"https://test-m-shop.mayi888.cn/innerApi/shopApiService"',
......
...@@ -3,6 +3,7 @@ module.exports = { ...@@ -3,6 +3,7 @@ module.exports = {
SHOP_MIXID:"'ant'", SHOP_MIXID:"'ant'",
NODE_ENV: '"production"', NODE_ENV: '"production"',
BASE_URL:"'https://shop.mayi888.com'", BASE_URL:"'https://shop.mayi888.com'",
ADMIN_URL:"'https://admin.mayi888.com'",
OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"', OLSHOP_URL:'"https://shop.mayi888.com/innerApi/shopApiService"',
IMG_DOMAIN: '"https://mayi-newshop.oss-cn-shanghai.aliyuncs.com"' IMG_DOMAIN: '"https://mayi-newshop.oss-cn-shanghai.aliyuncs.com"'
......
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
"mayi-front-tools": "^1.0.0", "mayi-front-tools": "^1.0.0",
"mpvue": "^2.0.0", "mpvue": "^2.0.0",
"mpvue-wxparse": "^0.6.5", "mpvue-wxparse": "^0.6.5",
"vuex": "^3.0.1" "vuex": "^3.0.1",
"we-cropper": "^1.4.0"
}, },
"devDependencies": { "devDependencies": {
"babel-core": "^6.22.1", "babel-core": "^6.22.1",
......
...@@ -101,9 +101,27 @@ ...@@ -101,9 +101,27 @@
}) })
}, },
selectImg(){ selectImg(){
let _this = this;
this._wecropper.getCropperImage().then(path=>{ this._wecropper.getCropperImage().then(path=>{
this.selectImgUrl = path;
console.log(path,'---path') console.log(path,'---path')
console.log(`${process.env.ADMIN_URL}/innerApi/baseService/upload/uploadFile.htm`,'-------url')
wx.uploadFile({
url: `${process.env.ADMIN_URL}/innerApi/baseService/upload/uploadFile.htm`, //仅为示例,非真实的接口地址
filePath: path,
name: 'file',
formData: {
'user': 'test'
},
success (res){
const data = res.data?JSON.parse(res.data):{};
console.log(data,'-----------118--success')
if(data.code == 200) {
_this.selectImgUrl = data.data.imgUrl;
}
//do something
},
})
}) })
} }
}, },
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<div v-if="showSpokesManHome"> <div v-if="showSpokesManHome">
<get-index-homepage class="getIndexHomePage"></get-index-homepage> <get-index-homepage class="getIndexHomePage"></get-index-homepage>
</div> </div>
<!-- <div style="font-size:40px;" @click="upImg">上传</div> --> <!-- <div style="font-size:40px;" @click="upImg">上传</div>
<!-- <mpvue-cropper v-if="chooseImg" :option="cropperOptions" @ready="cReady"></mpvue-cropper> --> <mpvue-cropper v-if="chooseImg" :option="cropperOptions" @ready="cReady"></mpvue-cropper> -->
<ThemeDataPlant></ThemeDataPlant> <ThemeDataPlant></ThemeDataPlant>
<div v-for="(item,index) in pageData" :key="index"> <div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1"> <div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1">
...@@ -426,6 +426,7 @@ export default { ...@@ -426,6 +426,7 @@ export default {
sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有 sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
success(res) { success(res) {
const src = res.tempFilePaths[0] const src = res.tempFilePaths[0]
console.log(src,'---------------chooseImage')
if (src) { if (src) {
// 将图片参数传递给插件 // 将图片参数传递给插件
self.chooseImg = true; self.chooseImg = true;
......
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