examine.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <view class="add-business-box">
  3. <Navbar :title="_userInfo.balance === 1 ? '顾客审核' : '顾客审核'" color="#333"></Navbar>
  4. <view class="content">
  5. <view class="item">
  6. <view class="label">店铺名称</view>
  7. {{info.shopName}}
  8. </view>
  9. <view class="item">
  10. <view class="label">主营项目</view>
  11. {{info.manageContent}}
  12. </view>
  13. <view class="item">
  14. <view class="label">商家类型</view>
  15. {{info.typeName}}
  16. </view>
  17. <view class="item">
  18. <view class="label">联系方式</text></view>
  19. {{info.shopPhone}}
  20. </view>
  21. <view class="item">
  22. <view class="label">引荐人</view>
  23. {{info.bindingUid}}
  24. </view>
  25. <view class="item item2">
  26. <view class="label">地址信息</view>
  27. {{info.shopAddress}}
  28. </view>
  29. <view class="item item2">
  30. <view class="label">商家描述</view>
  31. {{info.describe}}
  32. </view>
  33. <view class="item item2 master-img-box">
  34. <view class="label">商家主图</view>
  35. <view class="master-img">
  36. <image :src="info.shopIcon" class="img" mode=""></image>
  37. <!-- <IconText :code="`\ue84a`" size="12" color="#BDBBBB"></IconText> -->
  38. </view>
  39. </view>
  40. <view class="item item2">
  41. <view class="label">商家图片</view>
  42. <view class="upload-box">
  43. <view class="pic-box" v-for="item in info.shopPics" :key="item">
  44. <image :src="item" class="pic" mode="aspectFill" @click="preview(item)"></image>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="item item2">
  49. <view class="label">商家视频</view>
  50. <view class="upload-box">
  51. <view class="pic-box">
  52. <video v-if="info.shopVideo" :src="info.shopVideo" class="pic"></video>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="bottom">
  58. <div class="btn btn2" @click="examineRefuse">
  59. 拒绝
  60. </div>
  61. <div class="btn" @click="examinePass">
  62. 审核通过
  63. </div>
  64. </view>
  65. </view>
  66. </template>
  67. <script lang='ts'>
  68. import {
  69. Component,
  70. Prop,
  71. Vue
  72. } from 'vue-property-decorator';
  73. import {
  74. namespace
  75. } from 'vuex-class';
  76. const baseModule = namespace('base');
  77. @Component({})
  78. export default class AddBusiness extends Vue {
  79. @baseModule.Getter('_userInfo') _userInfo: any;
  80. typeList: any = [];
  81. shopType: any = {};
  82. addressInfo: any = {};
  83. info: any = {};
  84. data: any = {
  85. shopName: '',
  86. shopPhone: '',
  87. manageContent: '',
  88. bindingUid: null,
  89. shopType: null,
  90. shopAddress: '',
  91. house: '',
  92. describe: '',
  93. shopIcon: '',
  94. shopPics: [],
  95. lng: null,
  96. lat: null
  97. };
  98. onLoad() {
  99. let query = this.$Route.query;
  100. if (query.id) this.getInfo();
  101. // this.getTypeList();
  102. }
  103. preview(url: string): void {
  104. uni.previewImage({
  105. current: url, // 当前显示图片的http链接
  106. urls: [url] // 需要预览的图片http链接列表
  107. });
  108. }
  109. getInfo() {
  110. this.$http
  111. .get({
  112. url: this.$api.examineInfo,
  113. data: {
  114. id: this.$Route.query.id
  115. }
  116. })
  117. .then((res: any) => {
  118. this.info = res;
  119. }, (err: any) => {
  120. console.log(err);
  121. });
  122. }
  123. getTypeList() {
  124. this.$http
  125. .get({
  126. url: this.$api.getBusinessTypeList,
  127. })
  128. .then((res: any) => {
  129. this.typeList = res.list;
  130. }, (err: any) => {
  131. console.log(err);
  132. });
  133. }
  134. changeType(val: any) {
  135. let value = +val.detail.value;
  136. this.shopType = this.typeList[value];
  137. this.data.shopType = this.shopType.id;
  138. }
  139. getLocation() {
  140. uni.getLocation({
  141. type: 'wgs84',
  142. success: (res: any) => {
  143. // console.log(res, '经纬度')
  144. if (res.errMsg == 'getLocation:ok') {
  145. uni.chooseLocation({
  146. // 传入你要去的纬度
  147. latitude: this.data.lat || res.latitude,
  148. // 传入你要去的经度
  149. longitude: this.data.lng || res.longitude,
  150. // 传入你要去的地址信息 不填则为空
  151. // 缩放大小
  152. success: (info: any) => {
  153. this.data = {
  154. ...this.data,
  155. lat: info.latitude,
  156. lng: info.longitude,
  157. shopAddress: info.address
  158. };
  159. console.log(this.data)
  160. }
  161. });
  162. }
  163. }
  164. });
  165. }
  166. handleMasterImg() {
  167. uni.chooseImage({
  168. count: 1, //默认9
  169. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  170. success: (res) => {
  171. const tempFilePaths: any = res.tempFilePaths;
  172. uni.showLoading({
  173. title: '上传中...'
  174. });
  175. this.$http
  176. .upPic({
  177. filePath: res.tempFilePaths[0]
  178. })
  179. .then((res: any) => {
  180. this.data.shopIcon = res;
  181. uni.hideLoading();
  182. })
  183. .catch((err: any) => {
  184. uni.hideLoading();
  185. console.log(err);
  186. });
  187. }
  188. });
  189. }
  190. getImgs(pics: any) {
  191. this.data.shopPics = pics;
  192. }
  193. handleConfirm() {
  194. // console.log(this.data)
  195. uni.showLoading({
  196. title: '加载中...'
  197. });
  198. this.$http
  199. .post({
  200. url: this.$api.addBusiness,
  201. data: this.data
  202. })
  203. .then((res: any) => {
  204. uni.hideLoading();
  205. uni.showToast({
  206. title: '店铺入驻申请审核中,请稍后...',
  207. icon: 'none'
  208. });
  209. this.getInfo();
  210. }, (err: any) => {
  211. console.log(err);
  212. uni.hideLoading();
  213. });
  214. }
  215. handleUpdate() {
  216. console.log(this.data)
  217. uni.showLoading({
  218. title: '加载中...'
  219. });
  220. this.$http
  221. .put({
  222. url: this.$api.updateBusinessInfo,
  223. data: {
  224. id: this.info.id,
  225. ...this.data
  226. }
  227. })
  228. .then((res: any) => {
  229. uni.hideLoading();
  230. uni.showToast({
  231. title: '店铺入驻申请审核中,请稍后...',
  232. icon: 'none'
  233. });
  234. this.getInfo();
  235. }, (err: any) => {
  236. console.log(err);
  237. uni.hideLoading();
  238. });
  239. }
  240. examineRefuse() {
  241. this.$http
  242. .put({
  243. url: this.$api.examineRefuse,
  244. data: {
  245. id: this.info.id,
  246. rollback: '已拒绝'
  247. }
  248. })
  249. .then((res: any) => {
  250. uni.hideLoading();
  251. uni.showToast({
  252. title: '已拒绝审核',
  253. icon: 'none'
  254. });
  255. this.$Router.back(1);
  256. this.getInfo();
  257. }, (err: any) => {
  258. console.log(err);
  259. uni.hideLoading();
  260. });
  261. }
  262. examinePass() {
  263. this.$http
  264. .put({
  265. url: this.$api.examinePass,
  266. data: {
  267. id: this.info.id,
  268. }
  269. })
  270. .then((res: any) => {
  271. uni.hideLoading();
  272. uni.showToast({
  273. title: '已通过审核',
  274. icon: 'none'
  275. });
  276. this.$Router.back(1);
  277. this.getInfo();
  278. }, (err: any) => {
  279. console.log(err);
  280. uni.hideLoading();
  281. });
  282. }
  283. }
  284. </script>
  285. <style lang="scss" scoped>
  286. .add-business-box {
  287. .content {
  288. padding-bottom: vw(100);
  289. .item {
  290. height: vw(55);
  291. background: #fff;
  292. margin-top: vw(1);
  293. @include flex-x(flex-start);
  294. padding: 0 vw(15);
  295. font-size: vw(15);
  296. .label {
  297. @include word-vw(14, #333);
  298. width: vw(120);
  299. flex-shrink: 1;
  300. text {
  301. @include word-vw(14, #999);
  302. }
  303. }
  304. .input {
  305. width: vw(240);
  306. height: vw(50);
  307. background: #F6F6F6;
  308. border-radius: vw(5);
  309. padding: 0 vw(16);
  310. font-size: vw(14);
  311. box-sizing: border-box;
  312. }
  313. .selector {
  314. @include flex-x();
  315. @include word-vw(15, #999);
  316. .icon {
  317. margin-left: vw(5);
  318. }
  319. }
  320. .position {
  321. @include word-vw(14, #999);
  322. @include flex-x(flex-end);
  323. width: vw(240);
  324. .icon {
  325. margin-left: vw(5);
  326. }
  327. }
  328. }
  329. .item2 {
  330. height: auto;
  331. min-height: vw(55);
  332. padding: vw(12) vw(15);
  333. @include flex-x(flex-start, flex-start);
  334. .label {
  335. align-self: flex-start;
  336. padding-top: vw(3);
  337. }
  338. }
  339. .master-img-box {
  340. @include flex-x();
  341. }
  342. .master-img {
  343. @include flex-x();
  344. .img {
  345. width: vw(40);
  346. height: vw(40);
  347. background: #ccc;
  348. border-radius: vw(20);
  349. margin-right: vw(5);
  350. }
  351. }
  352. .upload-box {
  353. @include flex-x(flex-start);
  354. flex-wrap: wrap;
  355. }
  356. .pic-box {
  357. width: 1/3 * 100%;
  358. @include flex-y(center, center);
  359. }
  360. .pic {
  361. width: vw(66);
  362. height: vw(66);
  363. border-radius: vw(5);
  364. margin-bottom: vw(8);
  365. }
  366. }
  367. .bottom {
  368. width: 100%;
  369. position: fixed;
  370. bottom: 0;
  371. height: vw(70);
  372. background: #fff;
  373. @include flex-x(center);
  374. .btn {
  375. @include flex-x(center);
  376. @include solid-btn(148, 50, #fff, 10);
  377. margin: vw(5);
  378. box-sizing: border-box;
  379. }
  380. .btn2 {
  381. background: #FFF7F8;
  382. color: #333;
  383. border: vw(1) solid $btn-color;
  384. }
  385. }
  386. }
  387. </style>