酒店桌布为微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

360 lines
7.8 KiB

9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
  1. <template>
  2. <view class="applyLaundryStore">
  3. <navbar title="申请水洗店" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="frame">
  5. <view class="title">
  6. <span
  7. style="width: 10rpx;height: 40rpx;background-color: #f78142;border-radius: 10rpx;overflow: hidden;"></span>
  8. <span>店铺信息</span>
  9. </view>
  10. <view class="shopName">
  11. <view>店铺照片</view>
  12. <view>
  13. <uv-upload :fileList="fileList" multiple :maxCount="1" width="180rpx"
  14. height="180rpx" multiple @afterRead="afterRead" @delete="deleteImage">
  15. <image src="../static/help/uploading.png" mode="aspectFill"
  16. style="width: 180rpx;height: 180rpx;" />
  17. </uv-upload>
  18. </view>
  19. </view>
  20. <view class="shopName">
  21. <view>店铺名称</view>
  22. <view>
  23. <input v-model="form.name" placeholder="请输入店铺名称" clearable></input>
  24. </view>
  25. </view>
  26. <view class="shopName">
  27. <view>您的姓名</view>
  28. <view>
  29. <input v-model="form.userName" placeholder="请输入您的姓名" clearable></input>
  30. </view>
  31. </view>
  32. <view class="shopName">
  33. <view>联系方式</view>
  34. <view>
  35. <input v-model="form.phone" type="number" placeholder="请输入联系方式" clearable></input>
  36. </view>
  37. </view>
  38. <view class="shopName">
  39. <view>设置密码</view>
  40. <view>
  41. <input v-model="form.password" type="password" placeholder="请输入密码" clearable></input>
  42. </view>
  43. </view>
  44. <view class="currentRegion">
  45. <view>所在地区</view>
  46. <view @click.stop="selectAddr">
  47. <input class="input"
  48. disabled
  49. v-model="form.currentRegion" placeholder="请选择所在地区"></input>
  50. <view class="orientation">
  51. <!-- 定位 -->
  52. <image src="/static/image/address/selectIcon.png"
  53. style="width:30rpx;height: 30rpx;margin:5rpx 5rpx 5rpx 5rpx;"></image>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="shopName">
  58. <view>详细地址</view>
  59. <view>
  60. <input v-model="form.address" placeholder="详细地址" clearable></input>
  61. </view>
  62. </view>
  63. </view>
  64. <!-- 底部按钮 -->
  65. <bottomBtn @confirm='submitApplication()' :color='bottomBtnStyle.color'
  66. :backgroundColor='bottomBtnStyle.backgroundColor' :fontSize='bottomBtnStyle.fontSize'
  67. :text='bottomBtnStyle.text' :width="bottomBtnStyle.width" :height="bottomBtnStyle.height"
  68. :borderRadius='bottomBtnStyle.borderRadius' :bottom='bottomBtnStyle.bottom'>
  69. </bottomBtn>
  70. </view>
  71. </template>
  72. <script>
  73. import Position from '@/utils/position.js'
  74. import bottomBtn from "../../components/bottom/bottomBtn.vue"
  75. export default {
  76. components: {
  77. bottomBtn,
  78. },
  79. data() {
  80. return {
  81. form: {
  82. userName: '',
  83. name: '',
  84. phone: '',
  85. currentRegion: '',
  86. address: '',
  87. latitude: '',
  88. longitude: '',
  89. password : '',
  90. },
  91. bottomBtnStyle: {
  92. color: '#FFF',
  93. backgroundColor: '#fd5100',
  94. fontSize: '34rpx',
  95. text: '提交',
  96. width: '400rpx',
  97. height: '80rpx',
  98. borderRadius: '100rpx',
  99. bottom: '40rpx'
  100. },
  101. fileList: [],
  102. }
  103. },
  104. computed: {
  105. },
  106. onShow() {
  107. },
  108. methods: {
  109. deleteImage(e){
  110. this.fileList.splice(e.index, 1)
  111. },
  112. afterRead(e){
  113. let self = this
  114. e.file.forEach(file => {
  115. self.$Oss.ossUpload(file.url).then(url => {
  116. self.fileList.push({
  117. url
  118. })
  119. })
  120. })
  121. },
  122. // 提交按钮
  123. submitApplication() {
  124. this.form.pic = this.fileList.map((item) => item.url).join(",")
  125. if (this.$utils.verificationAll(this.form, {
  126. pic: '请上传店铺照片',
  127. name: '请输入店铺名称',
  128. userName: '请输入您的姓名',
  129. phone: '请输入联系方式',
  130. currentRegion: '请选择所在地区',
  131. address: '请输入详细地址',
  132. password : '请设置密码',
  133. })) {
  134. return
  135. }
  136. this.form.address = this.form.currentRegion + this.form.address
  137. this.$api('applyShopHotel', this.form, res => {
  138. if (res.code == 200) {
  139. uni.showToast({
  140. title: '申请成功待审核', // 提示的内容
  141. icon: 'success', // 图标,可选值有 'success', 'loading', 'none'
  142. duration: 1500 // 提示的持续时间,默认是1500毫秒
  143. });
  144. setTimeout(uni.navigateBack, 1500, -1)
  145. }
  146. })
  147. },
  148. //地图上选择地址
  149. selectAddr() {
  150. Position.getLocation(res => {
  151. Position.selectAddress(res.longitude, res.latitude, success => {
  152. this.setAddress(success)
  153. })
  154. })
  155. Position.getLocationDetail(res => {
  156. console.log(res);
  157. // this.form.address = res
  158. })
  159. },
  160. //提取用户选择的地址信息复制给表单数据
  161. setAddress(res) {
  162. //经纬度信息
  163. this.form.latitude = res.latitude
  164. this.form.longitude = res.longitude
  165. if (!res.address && res.name) { //用户直接选择城市的逻辑
  166. return this.form.currentRegion = res.name
  167. }
  168. if (res.address || res.name) {
  169. return this.form.currentRegion = res.address + res.name
  170. }
  171. this.form.currentRegion = '' //用户啥都没选就点击勾选
  172. },
  173. }
  174. }
  175. </script>
  176. <style lang="scss" scoped>
  177. * {
  178. box-sizing: border-box;
  179. }
  180. .applyLaundryStore {
  181. padding: 0 20rpx 0 20rpx;
  182. background-color: #f5f5f5;
  183. .frame {
  184. display: flex;
  185. flex-direction: column;
  186. gap: 20rpx;
  187. background-color: #FFF;
  188. margin-top: 20rpx;
  189. padding: 20rpx;
  190. .title {
  191. display: flex;
  192. // padding-top: 40rpx;
  193. font-size: 34rpx;
  194. font-weight: 700;
  195. padding: 0 0 0 20rpx;
  196. >span:nth-of-type(1) {
  197. margin: 4rpx 0 0 8rpx;
  198. background-color: #FFF;
  199. }
  200. >span:nth-of-type(2) {
  201. margin: 0 0 0 8rpx;
  202. background-color: #FFF;
  203. }
  204. }
  205. .shopName {
  206. display: flex;
  207. align-items: center;
  208. background-color: #FFF;
  209. // margin: 10rpx 0 0 0;
  210. padding: 10rpx 0 0 20rpx;
  211. >view:nth-of-type(1) {
  212. width: 30%;
  213. // font-weight: 700;
  214. }
  215. >view:nth-of-type(2) {
  216. width: 70%;
  217. // padding: 0 20rpx 0 0;
  218. border-radius: 10rpx;
  219. overflow: hidden;
  220. input {
  221. background-color: #f5f5f5;
  222. // color: #a4a4a4;
  223. font-size: 28rpx;
  224. padding: 8rpx 8rpx 8rpx 15rpx;
  225. }
  226. }
  227. }
  228. .name {
  229. display: flex;
  230. align-items: center;
  231. background-color: #FFF;
  232. height: 80rpx;
  233. // margin: 10rpx 0 0 0;
  234. padding: 10rpx 0 0 20rpx;
  235. >view:nth-of-type(1) {
  236. width: 30%;
  237. font-weight: 700;
  238. }
  239. >view:nth-of-type(2) {
  240. width: 70%;
  241. padding: 0 20rpx 0 0;
  242. }
  243. }
  244. .phone {
  245. display: flex;
  246. align-items: center;
  247. background-color: #FFF;
  248. height: 80rpx;
  249. // margin: 10rpx 0 0 0;
  250. padding: 10rpx 0 0 20rpx;
  251. >view:nth-of-type(1) {
  252. width: 30%;
  253. font-weight: 700;
  254. }
  255. >view:nth-of-type(2) {
  256. width: 70%;
  257. padding: 0 20rpx 0 0;
  258. }
  259. }
  260. .currentRegion {
  261. display: flex;
  262. align-items: center;
  263. background-color: #FFF;
  264. height: 80rpx;
  265. // margin: 10rpx 0 0 0;
  266. padding: 10rpx 0 0 20rpx;
  267. >view:nth-of-type(1) {
  268. width: 30%;
  269. // font-weight: 700;
  270. }
  271. >view:nth-of-type(2) {
  272. width: 70%;
  273. padding: 0 20rpx 0 0;
  274. display: flex;
  275. .input {
  276. background-color: #f5f5f5;
  277. // color: #a4a4a4;
  278. font-size: 28rpx;
  279. padding: 8rpx 8rpx 8rpx 15rpx;
  280. width: 350rpx;
  281. }
  282. .orientation {
  283. display: flex;
  284. padding: 10rpx 10rpx 10rpx 20rpx;
  285. font-size: 30rpx;
  286. color: #FBAB32;
  287. flex-direction: column;
  288. justify-content: center;
  289. align-items: center;
  290. }
  291. }
  292. }
  293. .detailedAddress {
  294. display: flex;
  295. align-items: center;
  296. background-color: #FFF;
  297. height: 80rpx;
  298. // margin: 10rpx 0 0 0;
  299. padding: 10rpx 0 0 20rpx;
  300. >view:nth-of-type(1) {
  301. width: 30%;
  302. font-weight: 700;
  303. }
  304. >view:nth-of-type(2) {
  305. width: 70%;
  306. padding: 0 20rpx 0 0;
  307. }
  308. }
  309. }
  310. }
  311. </style>