敢为人鲜小程序前端代码仓库
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.

376 lines
9.5 KiB

  1. 首页
  2. 工单管理
  3. 合并请求
  4. 里程碑
  5. 探索
  6. 通知
  7. 创建
  8. 个人信息和配置
  9. Augcl / teambuy-front
  10. 生成自 hly/uniapp-shop-templates
  11. 关注
  12. 1
  13. 点赞
  14. 0
  15. 派生
  16. 0
  17. 代码
  18. 工单
  19. 0
  20. 合并请求
  21. 0
  22. 项目
  23. 0
  24. 版本发布
  25. 0
  26. 百科
  27. 动态
  28. 敢为人鲜小程序前端代码仓库
  29. 58 提交
  30. 2 分支
  31. 57 MiB
  32. 分支: hfll
  33. teambuy-front/pages_order/mine/team.vue
  34. 335
  35. 8.7 KiB
  36. 原始文件
  37. 永久链接
  38. Blame
  39. 文件历史
  40. <template>
  41. <view class="page">
  42. <!-- 导航栏 -->
  43. <navbar title="团长申请" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
  44. <!-- 顶部图片区域 -->
  45. <view class="banner">
  46. <image src="/static/image/红烧肉.png" mode="aspectFill" class="banner-image"></image>
  47. </view>
  48. <view class="content-area">
  49. <!-- 送餐点照片上传区域 -->
  50. <view class="section-title">送餐点照片</view>
  51. <view class="section-block">
  52. <view class="upload-container">
  53. <view class="upload-area" @click="chooseImage" v-if="!locationImage">
  54. <view class="plus">+</view>
  55. <view class="upload-text">添加图片</view>
  56. </view>
  57. <image v-else :src="locationImage" mode="aspectFill" class="upload-area" @click="chooseImage" />
  58. </view>
  59. </view>
  60. <!-- 送餐点信息填写区域 -->
  61. <view class="section-title">送餐点信息</view>
  62. <view class="section-block">
  63. <view class="form-item">
  64. <text class="label">送餐点名称</text>
  65. <input class="input" type="text" v-model="formData.name" placeholder="请输入送餐点名称"
  66. placeholder-class="placeholder" />
  67. </view>
  68. <view class="form-item">
  69. <text class="label">您的姓名</text>
  70. <input class="input" type="text" v-model="formData.contactName" placeholder="请输入您的姓名"
  71. placeholder-class="placeholder" />
  72. </view>
  73. <view class="form-item">
  74. <text class="label">联系手机号</text>
  75. <input class="input" type="number" v-model="formData.contactPhone" placeholder="请输入您的手机号"
  76. placeholder-class="placeholder" />
  77. </view>
  78. <view class="form-item region-item" @click="showRegionPicker">
  79. <text class="label">所在地区</text>
  80. <view class="region-value">
  81. <text :class="{ 'placeholder': !formData.region }" style="color: #000;">{{ formData.region ||
  82. '请选择' }}</text>
  83. <uv-icon name="arrow-right" color="#000" />
  84. </view>
  85. </view>
  86. <view class="address-item">
  87. <text class="label">详细地址</text>
  88. <view class="address-box">
  89. <textarea class="address-input" v-model="formData.address" placeholder="请输入详细地址"
  90. placeholder-class="placeholder" />
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 提交按钮 -->
  95. <view class="submit-btn" @click="submitApplication">
  96. 提交申请
  97. </view>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. import navbar from '@/components/base/navbar.vue'
  103. export default {
  104. components: {
  105. navbar
  106. },
  107. data() {
  108. return {
  109. locationImage: '', // 上传的送餐点照片
  110. formData: {
  111. name: '', // 送餐点名称
  112. contactName: '', // 联系人姓名
  113. contactPhone: '', // 联系电话
  114. region: '', // 所在地区
  115. address: '' // 详细地址
  116. }
  117. }
  118. },
  119. methods: {
  120. // 选择图片
  121. chooseImage() {
  122. uni.chooseImage({
  123. count: 1,
  124. sizeType: ['compressed'],
  125. sourceType: ['album', 'camera'],
  126. success: (res) => {
  127. // 这里可以添加图片上传到服务器的逻辑
  128. // 暂时只展示选择的图片
  129. this.locationImage = res.tempFilePaths[0]
  130. }
  131. })
  132. },
  133. // 显示地区选择器(当前只是一个简单的点击反应)
  134. showRegionPicker() {
  135. // 模拟选择了一个地区
  136. this.formData.region = '长沙市雨花区'
  137. // 显示提示
  138. uni.showToast({
  139. title: '已选择地区',
  140. icon: 'none'
  141. })
  142. },
  143. // 提交申请
  144. submitApplication() {
  145. // 表单验证
  146. if (!this.locationImage) {
  147. return uni.showToast({
  148. title: '请上传送餐点照片',
  149. icon: 'none'
  150. })
  151. }
  152. if (!this.formData.name) {
  153. return uni.showToast({
  154. title: '请输入送餐点名称',
  155. icon: 'none'
  156. })
  157. }
  158. if (!this.formData.contactName) {
  159. return uni.showToast({
  160. title: '请输入您的姓名',
  161. icon: 'none'
  162. })
  163. }
  164. if (!this.formData.contactPhone) {
  165. return uni.showToast({
  166. title: '请输入联系手机号',
  167. icon: 'none'
  168. })
  169. }
  170. if (!this.$utils.verificationPhone(this.formData.contactPhone)) {
  171. return uni.showToast({
  172. title: '请输入正确的手机号',
  173. icon: 'none'
  174. })
  175. }
  176. if (!this.formData.region) {
  177. return uni.showToast({
  178. title: '请选择所在地区',
  179. icon: 'none'
  180. })
  181. }
  182. if (!this.formData.address) {
  183. return uni.showToast({
  184. title: '请输入详细地址',
  185. icon: 'none'
  186. })
  187. }
  188. // 显示提交中
  189. uni.showLoading({
  190. title: '提交中...'
  191. })
  192. // 模拟提交申请的过程
  193. setTimeout(() => {
  194. uni.hideLoading()
  195. uni.showModal({
  196. title: '提交成功!',
  197. content: '我们的工作人员会及时与您联系,\n请保持电话畅通!~',
  198. showCancel: false,
  199. confirmColor: '#019245',
  200. success: (res) => {
  201. if (res.confirm) {
  202. // 延迟返回上一页
  203. setTimeout(() => {
  204. this.$utils.navigateBack()
  205. }, 500)
  206. }
  207. }
  208. })
  209. }, 1000)
  210. }
  211. }
  212. }
  213. </script>
  214. <style lang="scss" scoped>
  215. .page {
  216. background-color: #f5f5f5;
  217. min-height: 100vh;
  218. }
  219. .banner {
  220. width: 100%;
  221. height: 240rpx;
  222. background-color: #019245;
  223. .banner-image {
  224. width: 100%;
  225. height: 100%;
  226. display: block;
  227. }
  228. }
  229. .content-area {
  230. padding: 20rpx;
  231. }
  232. .section-block {
  233. margin-bottom: 20rpx;
  234. background-color: #fff;
  235. border-radius: 20rpx;
  236. padding: 10rpx 20rpx;
  237. overflow: hidden;
  238. }
  239. .section-title {
  240. font-size: 28rpx;
  241. color: #333;
  242. padding: 20rpx;
  243. // border-bottom: 1rpx solid #f5f5f5;
  244. }
  245. .upload-container {
  246. padding: 20rpx;
  247. min-height: 140rpx;
  248. }
  249. .upload-area {
  250. width: 150rpx;
  251. height: 150rpx;
  252. border: 3rpx dashed $uni-color;
  253. // border-radius: 8rpx;
  254. display: flex;
  255. flex-direction: column;
  256. justify-content: center;
  257. align-items: center;
  258. .plus {
  259. font-size: 80rpx;
  260. color: $uni-color;
  261. line-height: 1;
  262. // margin-bottom: 5rpx;
  263. font-weight: 100;
  264. }
  265. .upload-text {
  266. font-size: 24rpx;
  267. color: $uni-color-third;
  268. }
  269. }
  270. .form-item {
  271. padding: 24rpx 0;
  272. display: flex;
  273. align-items: center;
  274. border-bottom: 2rpx solid #C7C7C7;
  275. &:last-child {
  276. border-bottom: none;
  277. }
  278. }
  279. .label {
  280. flex: 3;
  281. font-size: 28rpx;
  282. color: #333;
  283. padding-left: 10rpx;
  284. }
  285. .input {
  286. flex: 2;
  287. font-size: 28rpx;
  288. // height: 60rpx;
  289. text-align: left;
  290. }
  291. .placeholder,
  292. .region-item .region-value text.placeholder {
  293. // height: 60rpx;
  294. color: #999;
  295. }
  296. .region-item {
  297. cursor: pointer;
  298. .region-value {
  299. flex: 1;
  300. text-align: right;
  301. font-size: 28rpx;
  302. display: flex;
  303. justify-content: flex-end;
  304. align-items: center;
  305. }
  306. }
  307. .address-item {
  308. padding: 24rpx 0;
  309. display: flex;
  310. flex-direction: column;
  311. gap: 20rpx;
  312. .address-box {}
  313. .address-input {
  314. padding: 20rpx;
  315. background-color: #F5F5F5;
  316. border-radius: 10rpx;
  317. width: inherit;
  318. height: 60rpx;
  319. font-size: 28rpx;
  320. }
  321. }
  322. .submit-btn {
  323. width: 80%;
  324. margin: 40rpx auto 0;
  325. height: 100rpx;
  326. background-color: $uni-color;
  327. color: #fff;
  328. font-size: 32rpx;
  329. display: flex;
  330. justify-content: center;
  331. align-items: center;
  332. border-radius: 50rpx;
  333. // margin-top: 60rpx;
  334. }
  335. </style>