1 line
24 KiB
Plaintext
1 line
24 KiB
Plaintext
{"version":3,"sources":["webpack:///D:/Lee/leave-unused/pagesA/release/release.vue?89a7","webpack:///D:/Lee/leave-unused/pagesA/release/release.vue?d072","uni-app:///main.js","webpack:///D:/Lee/leave-unused/pagesA/release/release.vue?2b29","webpack:///D:/Lee/leave-unused/pagesA/release/release.vue?0f25","webpack:///D:/Lee/leave-unused/pagesA/release/release.vue?b87a","webpack:///D:/Lee/leave-unused/pagesA/release/release.vue?a9ff","uni-app:///pagesA/release/release.vue"],"names":["wx","__webpack_require_UNI_MP_PLUGIN__","__webpack_require__","createPage","Page","data","statusHeight","pageTitle","estateList","estateIndex","cateList","cateIndex","goodsDetail","cover","goodsImg","phone","isEdit","isLoading","page","size","StagingImg","goods_id","onLoad","methods","getUserInfo","console","getEstateList","res","id","name","estateArr","getCateList","cateArr","getGoodsDetail","original_price","price","msg","addGoodsEv","title","category_id","area_id","images","content","setTimeout","uni","delta","fail","url","choiceCate","choiceEstate","changeImg","count","sourceType","success","uploadImg","path","delImg"],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAq9B,CAAgB,o8BAAG,EAAC,C;;;;;;;;;;;ACAz+B;AACA,OAAO,KAAU,EAAE,kBAKd;;;;;;;;;;;;;;;;ACNL;AAGA;AACA;AAHA;AACAA,EAAE,CAACC,iCAAiC,GAAGC,mBAAmB;AAG1DC,UAAU,CAACC,gBAAI,CAAC,C;;;;;;;;;;;;;ACLhB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAgI;AAChI;AAC2D;AACL;AACqC;;;AAG3F;AAC6K;AAC7K,gBAAgB,uLAAU;AAC1B,EAAE,6EAAM;AACR,EAAE,8FAAM;AACR,EAAE,uGAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,kGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA,aAAa,oMAEN;AACP,KAAK;AACL;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAspB,CAAgB,mqBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eCuE1qB;EACAC;IACA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;MAAA;MACAC;IACA;EACA;EACAC;IACA;MACA;MACA;MACA;MACA;MACA;IACA;MACA;MACA;MACA;IACA;IACA;IACA;EACA;EACAC;IACA;IACAC;MAAA;MACA;QACAC;QACA;UACA;QACA;MACA;IACA;IACA;IACAC;MAAA;MACA;QACA;UACAD;UACA;UACAE;YACA;cACAC;cACAC;YACA;YACAC;UACA;UACA;UACA;YAAA;UAAA;UACA;UACA;QACA;MACA;IACA;IAEA;IACAC;MAAA;MACA;MACA;QACA;UACAN;UACA;UACAE;YACA;cACAC;cACAC;YACA;YACAG;UACA;UACA;UACA;YACA;YACA;UACA;YACA;UACA;QACA;MACA;IACA;IAEA;IACAC;MAAA;MACA;QAAAL;MAAA;QACA;UACAH;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;YAAA;UAAA;UACA;UACA;YAAA;UAAA;UACA;UACA;YACAG;YACAC;YACAK;YACAC;YACAC;UACA;QACA;QACA;MACA;IACA;IAEA;IACAC;MAAA;MACA;QACAT;QACAU;QACAzB;QACA0B;QACAC;QACAzB;QACAmB;QACAC;QACAM;QACAC;MACA;MACA;QACA;UACA;YACA;YACAC;cACAC;gBACAC;gBACAC;kBACAF;oBACAG;kBACA;gBACA;cACA;YACA;UACA;YACA;YACAJ;cACAC;gBACAG;cACA;YACA;UACA;QACA;UACA;QACA;MACA;IACA;IAEA;IACAC;MACA;IACA;IAEA;IACAC;MACA;IACA;IAEA;IACAC;MAAA;MACA;MACAN;QACAO;QAAA;QACAC;QAAA;QACAC;UACA;UACA;UACA;QACA;MACA;IACA;IAEA;IACAC;MAAA;MACAV;QACAN;MACA;MACA;QAAAiB;MAAA;QACA;UACA;YACA;UACA;UACA;YACA;UACA;QACA;QACAX;MACA;IACA;IAEA;IACAY;MACA;IACA;EACA;AACA;AAAA,2B","file":"pagesA/release/release.js","sourcesContent":["import mod from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./release.vue?vue&type=style&index=0&id=3893cd0a&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--6-oneOf-1-2!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-3!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./release.vue?vue&type=style&index=0&id=3893cd0a&scoped=true&lang=css&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1672107698955\n var cssReload = require(\"D:/HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n ","import 'uni-pages';\n// @ts-ignore\nwx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;\nimport Vue from 'vue'\nimport Page from './pagesA/release/release.vue'\ncreatePage(Page)","import { render, staticRenderFns, recyclableRender, components } from \"./release.vue?vue&type=template&id=3893cd0a&scoped=true&\"\nvar renderjs\nimport script from \"./release.vue?vue&type=script&lang=js&\"\nexport * from \"./release.vue?vue&type=script&lang=js&\"\nimport style0 from \"./release.vue?vue&type=style&index=0&id=3893cd0a&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"3893cd0a\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"pagesA/release/release.vue\"\nexport default component.exports","export * from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./release.vue?vue&type=template&id=3893cd0a&scoped=true&\"","var components\ntry {\n components = {\n statusNav: function () {\n return import(\n /* webpackChunkName: \"components/status-nav/status-nav\" */ \"@/components/status-nav/status-nav.vue\"\n )\n },\n }\n} catch (e) {\n if (\n e.message.indexOf(\"Cannot find module\") !== -1 &&\n e.message.indexOf(\".vue\") !== -1\n ) {\n console.error(e.message)\n console.error(\"1. 排查组件名称拼写是否正确\")\n console.error(\n \"2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom\"\n )\n console.error(\n \"3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件\"\n )\n } else {\n throw e\n }\n}\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n if (!_vm._isMounted) {\n _vm.e0 = function ($event) {\n _vm.cover = \"\"\n }\n }\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./release.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../HbuilderX/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./release.vue?vue&type=script&lang=js&\"","<template>\n\t<view class=\"pad-x20\" v-if=\"isLoading\">\r\n\t\t<!-- 头部 -->\n\t\t<status-nav :ifReturn=\"true\" :navBarTitle=\"pageTitle\"></status-nav>\r\n\t\t<!-- 提示 -->\r\n\t\t<view class=\"notice-tips color-orange font26 border-box pad-all20 flex\"><image src=\"/static/icon-notice.png\" mode=\"widthFix\"></image>请确保商品信息及联系方式的真实性!</view>\r\n\t\t<!-- 商品编辑 -->\r\n\t\t<view class=\"release-form color-48 background-white border-box\">\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">小区选择<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<picker mode=\"selector\" :range=\"estateList\" @change=\"choiceEstate\" :value=\"estateIndex\" :range-key=\"'name'\">\r\n\t\t\t\t\t<view class=\"cate-name\">\r\n\t\t\t\t\t\t<text>{{estateList[estateIndex].name}}</text>\r\n\t\t\t\t\t\t<image src=\"/static/icon-arrow-down.png\" mode=\"\"></image>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</picker>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">商品分类<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<picker mode=\"selector\" :range=\"cateList\" @change=\"choiceCate\" :value=\"cateIndex\" :range-key=\"'name'\">\r\n\t\t\t\t\t<view class=\"cate-name\">\r\n\t\t\t\t\t\t<text>{{cateList[cateIndex].name}}</text>\r\n\t\t\t\t\t\t<image src=\"/static/icon-arrow-down.png\" mode=\"\"></image>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</picker>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">商品名称<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<input type=\"text\" v-model=\"goodsDetail.name\" placeholder=\"请输入商品名称\" placeholder-style=\"color:#8c8c9b\">\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">商品原价</view>\r\n\t\t\t\t<input type=\"number\" v-model=\"goodsDetail.original_price\" placeholder=\"请输入商品原价\" placeholder-style=\"color:#8c8c9b\">\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">商品售价<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<input type=\"number\" v-model=\"goodsDetail.price\" placeholder=\"请输入商品售价\" placeholder-style=\"color:#8c8c9b\">\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">联系方式<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<input type=\"number\" v-model=\"phone\" placeholder=\"请输入联系方式\" placeholder-style=\"color:#8c8c9b\">\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">商品描述<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<textarea v-model=\"goodsDetail.msg\" placeholder=\"请输入商品描述\" placeholder-style=\"color:#8c8c9b\"></textarea>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">封面图<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<view class=\"upload-box border-box flex\">\r\n\t\t\t\t\t<view class=\"img radius10 border-box\" v-if=\"cover!==''\">\r\n\t\t\t\t\t\t<image :src=\"cover\" mode=\"widthFix\"></image>\r\n\t\t\t\t\t\t<image class=\"del-btn\" src=\"/static/icon-del.png\" mode=\"widthFix\" @tap=\"cover=''\"></image>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"upload-btn radius10 border-box flex\" @tap=\"changeImg('cover')\" v-if=\"cover==''\"><image src=\"/static/icon-release.png\" mode=\"widthFix\"></image></view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"item font26 mar-x30 flex\">\r\n\t\t\t\t<view class=\"title\">商品图片<text class=\"color-red\">*</text></view>\r\n\t\t\t\t<view class=\"upload-box border-box flex\">\r\n\t\t\t\t\t<view class=\"img radius10 border-box\" v-for=\"(item,index) in goodsImg\" :key=\"index\">\r\n\t\t\t\t\t\t<image :src=\"item\" mode=\"widthFix\"></image>\r\n\t\t\t\t\t\t<image class=\"del-btn\" src=\"/static/icon-del.png\" mode=\"widthFix\" @tap=\"delImg(index)\"></image>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"upload-btn radius10 border-box flex\" @tap=\"changeImg('img')\" v-if=\"goodsImg.length<4\"><image src=\"/static/icon-release.png\" mode=\"widthFix\"></image></view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t\t<view class=\"release-btn background-blue font32 radius10 color-ff flex\" @tap=\"addGoodsEv\">提交</view>\r\n\t</view>\n</template>\n<script>\r\n\texport default {\n\t\tdata() {\n\t\t\treturn {\r\n\t\t\t\tstatusHeight:uni.getSystemInfoSync().statusBarHeight, //状态栏高度\r\n\t\t\t\tpageTitle:'', //页面名称\r\n\t\t\t\testateList:[], //小区列表\r\n\t\t\t\testateIndex:0, //小区选择\r\n\t\t\t\tcateList:[], //分类列表\r\n\t\t\t\tcateIndex:0, //分类选择\r\n\t\t\t\tgoodsDetail:{}, //商品详情\r\n\t\t\t\tcover:'', //封面图\r\n\t\t\t\tgoodsImg:[], //商品图片\r\n\t\t\t\tphone:'', //联系电话\r\n\t\t\t\tisEdit:false, //是否编辑进入\r\n\t\t\t\tisLoading:false, //是否记载完成\r\n\t\t\t\tpage:1, //页数\r\n\t\t\t\tsize:100, //条数\r\n\t\t\t\tStagingImg:'', //暂存img \r\n\t\t\t\tgoods_id:-1, //商品id\r\n\t\t\t}\n\t\t},\r\n\t\tonLoad(op) {\r\n\t\t\tif(op.id){\r\n\t\t\t\t// 判断是否是编辑进入\r\n\t\t\t\tthis.isEdit = true;\r\n\t\t\t\tthis.pageTitle = '编辑商品';\r\n\t\t\t\t// 获取商品id\r\n\t\t\t\tthis.goods_id = op.id;\r\n\t\t\t}else{\r\n\t\t\t\tthis.pageTitle = '新增商品';\r\n\t\t\t\t// 获取用户信息\r\n\t\t\t\tthis.getUserInfo();\r\n\t\t\t}\r\n\t\t\t// 查询小区列表\r\n\t\t\tthis.getEstateList();\r\n\t\t},\n\t\tmethods: {\r\n\t\t\t// 获取用户信息\r\n\t\t\tgetUserInfo(){\r\n\t\t\t\tthis.$requst.get('/api/v1/user/info').then(res=>{\r\n\t\t\t\t\tconsole.log(res,'用户信息');\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tthis.phone = res.data.mobile;\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t// 查询小区列表\r\n\t\t\tgetEstateList(){\r\n\t\t\t\tthis.$requst.get('/api/v1/goods/area').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'小区列表')\r\n\t\t\t\t\t\tlet estateArr = [];\r\n\t\t\t\t\t\tres.data.list.forEach(item=>{\r\n\t\t\t\t\t\t\tlet obj = {\r\n\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\tname:item.title,\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\testateArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.estateList = this.estateList.concat(estateArr);\r\n\t\t\t\t\t\tthis.estateIndex = this.estateList.findIndex(item=> item.id === uni.getStorageSync('area_id'));\r\n\t\t\t\t\t\t// 查询分类\r\n\t\t\t\t\t\tthis.getCateList();\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 查询分类\n\t\t\tgetCateList(){\r\n\t\t\t\tif(this.page==1) this.goodsList = [];\r\n\t\t\t\tthis.$requst.get('/api/v1/goods/category').then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'物品分类列表')\r\n\t\t\t\t\t\tlet cateArr = [];\r\n\t\t\t\t\t\tres.data.forEach(item=>{\r\n\t\t\t\t\t\t\tlet obj = {\r\n\t\t\t\t\t\t\t\tid:item.id,\r\n\t\t\t\t\t\t\t\tname:item.title\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcateArr.push(obj)\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\tthis.cateList = cateArr;\r\n\t\t\t\t\t\tif(this.isEdit){\r\n\t\t\t\t\t\t\t// 查询商品详情\r\n\t\t\t\t\t\t\tthis.getGoodsDetail(this.goods_id);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.isLoading = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 查询商品详情\r\n\t\t\tgetGoodsDetail(id){\r\n\t\t\t\tthis.$requst.get('/api/v1/goods/detail',{id:id}).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tconsole.log(res,'闲置商品详情');\r\n\t\t\t\t\t\t// 获取图片\r\n\t\t\t\t\t\tthis.goodsImg = res.data.images;\r\n\t\t\t\t\t\t// 获取电话\r\n\t\t\t\t\t\tthis.phone = res.data.phone;\r\n\t\t\t\t\t\t// 获取封面图\r\n\t\t\t\t\t\tthis.cover = res.data.cover;\r\n\t\t\t\t\t\t// 获取当前分类\r\n\t\t\t\t\t\tthis.cateIndex = this.cateList.findIndex(item=> item.name === res.data.category_name);\r\n\t\t\t\t\t\t// 获取当前小区\r\n\t\t\t\t\t\tthis.estateIndex = this.estateList.findIndex(item=> item.name === res.data.area_name);\r\n\t\t\t\t\t\t// 获取商品详情\r\n\t\t\t\t\t\tthis.goodsDetail = {\r\n\t\t\t\t\t\t\tid:res.data.id,\r\n\t\t\t\t\t\t\tname:res.data.title,\r\n\t\t\t\t\t\t\toriginal_price:parseFloat(res.data.original_price),\r\n\t\t\t\t\t\t\tprice:parseFloat(res.data.price),\r\n\t\t\t\t\t\t\tmsg:res.data.content\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.isLoading = true;\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 新增or编辑闲置商品\r\n\t\t\taddGoodsEv(){\r\n\t\t\t\tlet params = {\r\n\t\t\t\t\tid:this.goods_id!==-1?this.goods_id:'',\r\n\t\t\t\t\ttitle:this.goodsDetail.name,\r\n\t\t\t\t\tcover:this.cover,\r\n\t\t\t\t\tcategory_id:this.cateList[this.cateIndex].id,\r\n\t\t\t\t\tarea_id:this.estateList[this.estateIndex].id,\r\n\t\t\t\t\tphone:this.phone,\r\n\t\t\t\t\toriginal_price:this.goodsDetail.original_price,\r\n\t\t\t\t\tprice:this.goodsDetail.price,\r\n\t\t\t\t\timages:this.goodsImg.join(','),\r\n\t\t\t\t\tcontent:this.goodsDetail.msg\r\n\t\t\t\t}\r\n\t\t\t\tthis.$requst.post(this.isEdit?'/api/v1/goods/edit':'/api/v1/goods/add',params).then(res=>{\r\n\t\t\t\t\tif(res.code == 0){\r\n\t\t\t\t\t\tif(this.isEdit){\r\n\t\t\t\t\t\t\tthis.$toolAll.tools.showToast('修改成功');\r\n\t\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\t\tuni.navigateBack({\r\n\t\t\t\t\t\t\t\t\tdelta: 1,\r\n\t\t\t\t\t\t\t\t\tfail: () => {\r\n\t\t\t\t\t\t\t\t\t\tuni.reLaunch({\r\n\t\t\t\t\t\t\t\t\t\t\turl: '/pages/idle/idle'\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t},500)\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tthis.$toolAll.tools.showToast('添加成功');\r\n\t\t\t\t\t\t\tsetTimeout(()=>{\r\n\t\t\t\t\t\t\t\tuni.reLaunch({\r\n\t\t\t\t\t\t\t\t\turl:'/pages/idle/idle',\r\n\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t},500)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tthis.$toolAll.tools.showToast(res.msg);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择分类\r\n\t\t\tchoiceCate(e){\r\n\t\t\t\tthis.cateIndex = e.detail.value;\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择小区\r\n\t\t\tchoiceEstate(e){\r\n\t\t\t\tthis.estateIndex = e.detail.value;\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 选择图片\r\n\t\t\tchangeImg(type){\r\n\t\t\t\tif(type=='cover') this.cover = '';\r\n\t\t\t\tuni.chooseImage({\r\n\t\t\t\t\tcount: 1, //默认9\r\n\t\t\t\t\tsourceType: ['album','camera'], //从相册选择\r\n\t\t\t\t\tsuccess: (res)=> {\r\n\t\t\t\t\t\tthis.StagingImg = res.tempFilePaths[0];\r\n\t\t\t\t\t\t// 上传图片\r\n\t\t\t\t\t\tthis.uploadImg(type);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 上传图片\r\n\t\t\tuploadImg(type){\r\n\t\t\t\tuni.showLoading({\r\n\t\t\t\t\ttitle: '上传中'\r\n\t\t\t\t});\r\n\t\t\t\tthis.$requst.upload('/api/v1/file/upload/image',{path:this.StagingImg}).then(res=>{\r\n\t\t\t\t\tif(res.code==0) {\r\n\t\t\t\t\t\tif(type=='cover'){\r\n\t\t\t\t\t\t\tthis.cover = this.$hostHttp+res.data.src;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(type=='img'){\r\n\t\t\t\t\t\t\tthis.goodsImg.push(this.$hostHttp+res.data.src);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tuni.hideLoading();\r\n\t\t\t\t})\r\n\t\t\t},\r\n\t\t\t\r\n\t\t\t// 删除图片\r\n\t\t\tdelImg(index){\r\n\t\t\t\tthis.goodsImg.splice(index,1);\r\n\t\t\t}\n\t\t}\n\t}\n</script>\n<style scoped>\r\n\t.notice-tips{\r\n\t\talign-items: center;\r\n\t\tbackground-color: rgba(255,133,0,.2);\r\n\t\theight: 70rpx;\r\n\t\tline-height: 36rpx;\r\n\t}\r\n\t.notice-tips>image{\r\n\t\twidth: 40rpx;\r\n\t\theight: 40rpx;\r\n\t\tmargin-right: 8rpx;\r\n\t\tanimation: opacity_name 0.8s linear alternate infinite;\r\n\t}\r\n\t@keyframes opacity_name {\r\n\t\tfrom {\r\n\t\t\topacity: .1;\r\n\t\t\ttransform: scale(.8);\r\n\t\t}\r\n\t\tto {\r\n\t\t\topacity: 1;\r\n\t\t\ttransform: scale(1.2);\r\n\t\t}\r\n\t}\r\n\t.release-form{\r\n\t\tpadding: 20rpx;\r\n\t}\r\n\t.release-form .item{\r\n\t\talign-items: center;\r\n\t}\r\n\t.release-form .item:last-child{\r\n\t\tmargin-bottom: 0;\r\n\t}\r\n\t.release-form .item>.title{\r\n\t\twidth: 140rpx;\r\n\t}\r\n\t.release-form .item>picker,\r\n\t.release-form .item>input,\r\n\t.release-form .item>textarea{\r\n\t\tbox-sizing: border-box;\r\n\t\twidth: calc(100% - 140rpx);\r\n\t\theight: 80rpx;\r\n\t\tpadding: 0 10rpx;\r\n\t\tborder: 2rpx solid #f4f5f6;\r\n\t\tborder-radius: 5rpx;\r\n\t}\r\n\t.release-form .item>textarea{\r\n\t\tpadding: 10rpx;\r\n\t\theight: 200rpx;\r\n\t\tline-height: 1.5;\r\n\t}\r\n\t.release-form .item .cate-name{\r\n\t\tdisplay: flex;\r\n\t\tjustify-content: space-between;\r\n\t\talign-items: center;\r\n\t\twidth: 100%;\r\n\t\theight: 76rpx;\r\n\t}\r\n\t.release-form .item image{\r\n\t\twidth: 28rpx;\r\n\t\theight: 16rpx;\r\n\t}\r\n\t.release-form .item>.upload-box{\r\n\t\tflex-wrap: wrap;\r\n\t\tbox-sizing: border-box;\r\n\t\twidth: calc(100% - 140rpx);\r\n\t}\r\n\t.release-form .item .img,\r\n\t.release-form .item .upload-btn{\r\n\t\tposition: relative;\r\n\t\twidth: 132rpx;\r\n\t\theight: 132rpx;\r\n\t\tmargin: 10rpx 10rpx 0 0;\r\n\t\toverflow: hidden;\r\n\t}\r\n\t.release-form .item>.img:nth-of-type(4n){\r\n\t\tmargin-right: 0;\r\n\t}\r\n\t.release-form .item .img>image:first-child{\r\n\t\twidth: 100%;\r\n\t\tmin-height: 100%;\r\n\t}\r\n\t.release-form .item .img>.del-btn{\r\n\t\twidth: 30rpx;\r\n\t\theight: 30rpx;\r\n\t\tposition: absolute;\r\n\t\tright: 2rpx;\r\n\t\ttop: 2rpx;\r\n\t}\r\n\t.release-form .item .upload-btn{\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\tmargin-right: 0;\r\n\t\tbackground-color: #ccc;\r\n\t}\r\n\t.release-form .item .upload-btn>image{\r\n\t\twidth: 48rpx;\r\n\t\theight: 48rpx;\r\n\t\tfilter: grayscale(100%);\r\n\t}\r\n\t.release-btn{\r\n\t\tjustify-content: center;\r\n\t\talign-items: center;\r\n\t\twidth: 80%;\r\n\t\theight: 90rpx;\r\n\t\tmargin: 40rpx auto 0;\r\n\t}\r\n</style>"],"sourceRoot":""} |