酒店桌布为微信小程序
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.

367 lines
7.9 KiB

7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
5 months ago
7 months ago
5 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 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. if(!this.$utils.verificationPhone(this.form.phone)){
  137. return uni.showToast({
  138. title: '手机号格式不正确',
  139. icon:'none'
  140. })
  141. }
  142. this.form.address = this.form.currentRegion + this.form.address
  143. this.$api('applyShopHotel', this.form, res => {
  144. if (res.code == 200) {
  145. uni.showToast({
  146. title: '申请成功待审核', // 提示的内容
  147. icon: 'success', // 图标,可选值有 'success', 'loading', 'none'
  148. duration: 1500 // 提示的持续时间,默认是1500毫秒
  149. });
  150. setTimeout(uni.navigateBack, 1500, -1)
  151. }
  152. })
  153. },
  154. //地图上选择地址
  155. selectAddr() {
  156. Position.getLocation(res => {
  157. Position.selectAddress(res.longitude, res.latitude, success => {
  158. this.setAddress(success)
  159. })
  160. })
  161. Position.getLocationDetail(res => {
  162. console.log(res);
  163. // this.form.address = res
  164. })
  165. },
  166. //提取用户选择的地址信息复制给表单数据
  167. setAddress(res) {
  168. //经纬度信息
  169. this.form.latitude = res.latitude
  170. this.form.longitude = res.longitude
  171. if (!res.address && res.name) { //用户直接选择城市的逻辑
  172. return this.form.currentRegion = res.name
  173. }
  174. if (res.address || res.name) {
  175. return this.form.currentRegion = res.address + res.name
  176. }
  177. this.form.currentRegion = '' //用户啥都没选就点击勾选
  178. },
  179. }
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. * {
  184. box-sizing: border-box;
  185. }
  186. .applyLaundryStore {
  187. padding: 0 20rpx 0 20rpx;
  188. background-color: #f5f5f5;
  189. .frame {
  190. display: flex;
  191. flex-direction: column;
  192. gap: 20rpx;
  193. background-color: #FFF;
  194. margin-top: 20rpx;
  195. padding: 20rpx;
  196. .title {
  197. display: flex;
  198. // padding-top: 40rpx;
  199. font-size: 34rpx;
  200. font-weight: 700;
  201. padding: 0 0 0 20rpx;
  202. >span:nth-of-type(1) {
  203. margin: 4rpx 0 0 8rpx;
  204. background-color: #FFF;
  205. }
  206. >span:nth-of-type(2) {
  207. margin: 0 0 0 8rpx;
  208. background-color: #FFF;
  209. }
  210. }
  211. .shopName {
  212. display: flex;
  213. align-items: center;
  214. background-color: #FFF;
  215. // margin: 10rpx 0 0 0;
  216. padding: 10rpx 0 0 20rpx;
  217. >view:nth-of-type(1) {
  218. width: 30%;
  219. // font-weight: 700;
  220. }
  221. >view:nth-of-type(2) {
  222. width: 70%;
  223. // padding: 0 20rpx 0 0;
  224. border-radius: 10rpx;
  225. overflow: hidden;
  226. input {
  227. background-color: #f5f5f5;
  228. // color: #a4a4a4;
  229. font-size: 28rpx;
  230. padding: 8rpx 8rpx 8rpx 15rpx;
  231. }
  232. }
  233. }
  234. .name {
  235. display: flex;
  236. align-items: center;
  237. background-color: #FFF;
  238. height: 80rpx;
  239. // margin: 10rpx 0 0 0;
  240. padding: 10rpx 0 0 20rpx;
  241. >view:nth-of-type(1) {
  242. width: 30%;
  243. font-weight: 700;
  244. }
  245. >view:nth-of-type(2) {
  246. width: 70%;
  247. padding: 0 20rpx 0 0;
  248. }
  249. }
  250. .phone {
  251. display: flex;
  252. align-items: center;
  253. background-color: #FFF;
  254. height: 80rpx;
  255. // margin: 10rpx 0 0 0;
  256. padding: 10rpx 0 0 20rpx;
  257. >view:nth-of-type(1) {
  258. width: 30%;
  259. font-weight: 700;
  260. }
  261. >view:nth-of-type(2) {
  262. width: 70%;
  263. padding: 0 20rpx 0 0;
  264. }
  265. }
  266. .currentRegion {
  267. display: flex;
  268. align-items: center;
  269. background-color: #FFF;
  270. height: 80rpx;
  271. // margin: 10rpx 0 0 0;
  272. padding: 10rpx 0 0 20rpx;
  273. >view:nth-of-type(1) {
  274. width: 30%;
  275. // font-weight: 700;
  276. }
  277. >view:nth-of-type(2) {
  278. width: 70%;
  279. padding: 0 20rpx 0 0;
  280. display: flex;
  281. .input {
  282. background-color: #f5f5f5;
  283. // color: #a4a4a4;
  284. font-size: 28rpx;
  285. padding: 8rpx 8rpx 8rpx 15rpx;
  286. width: 350rpx;
  287. }
  288. .orientation {
  289. display: flex;
  290. padding: 10rpx 10rpx 10rpx 20rpx;
  291. font-size: 30rpx;
  292. color: #FBAB32;
  293. flex-direction: column;
  294. justify-content: center;
  295. align-items: center;
  296. }
  297. }
  298. }
  299. .detailedAddress {
  300. display: flex;
  301. align-items: center;
  302. background-color: #FFF;
  303. height: 80rpx;
  304. // margin: 10rpx 0 0 0;
  305. padding: 10rpx 0 0 20rpx;
  306. >view:nth-of-type(1) {
  307. width: 30%;
  308. font-weight: 700;
  309. }
  310. >view:nth-of-type(2) {
  311. width: 70%;
  312. padding: 0 20rpx 0 0;
  313. }
  314. }
  315. }
  316. }
  317. </style>