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

317 lines
6.5 KiB

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