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

259 lines
7.4 KiB

  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="解绑团长" leftClick @leftClick="$utils.navigateBack" bgColor="#019245" color="#fff" />
  5. <!-- 当前取餐点 -->
  6. <view class="section">
  7. <view class="section-title">当前取餐点</view>
  8. <view class="pickup-item" v-if="currentPickupPoint">
  9. <view class="pickup-image">
  10. <image :src="currentPickupPoint.spotImage" mode="aspectFill"></image>
  11. </view>
  12. <view class="pickup-info">
  13. <view class="pickup-name">{{ currentPickupPoint.spotName }}</view>
  14. <view class="pickup-address">
  15. <view class="pickup-address-icon">
  16. <uv-icon name="map-fill" color="#019245" size="24"></uv-icon>
  17. </view>
  18. <text>{{ currentPickupPoint.area }}{{ currentPickupPoint.address }}</text>
  19. </view>
  20. <view class="pickup-phone">
  21. <uv-icon name="phone-fill" color="#019245" size="24"></uv-icon>
  22. <text>{{ currentPickupPoint.phone }}</text>
  23. </view>
  24. </view>
  25. <view class="status-icon">
  26. <uv-icon name="checkmark-circle-fill" color="#019245" size="40"></uv-icon>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- 附近取餐点 -->
  31. <view class="section">
  32. <view class="section-title">附近取餐点</view>
  33. <!-- 提示信息 -->
  34. <view class="warning-tip">
  35. <uv-icon name="info-circle" color="#FF5722" size="36"></uv-icon>
  36. <text>更换取餐地址和团长,需通过平台审核方可更换!</text>
  37. </view>
  38. <!-- 取餐点列表 -->
  39. <view class="pickup-list">
  40. <view class="pickup-item" v-for="(item, index) in nearbyPickupPoints" :key="index">
  41. <view class="pickup-image">
  42. <image :src="item.spotImage" mode="aspectFill"></image>
  43. </view>
  44. <view class="pickup-info">
  45. <view class="pickup-name">{{ item.spotName }}</view>
  46. <view class="pickup-address">
  47. <view class="pickup-address-icon">
  48. <uv-icon name="map-fill" color="#019245" size="24"></uv-icon>
  49. </view>
  50. <text>{{ item.area }}</text>
  51. </view>
  52. <view class="pickup-phone">
  53. <uv-icon name="phone-fill" color="#019245" size="24"></uv-icon>
  54. <text>{{ item.phone }}</text>
  55. </view>
  56. </view>
  57. <view class="select-btn" @click="selectPickupPoint(item)">
  58. <text>选择</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import navbar from '@/components/base/navbar.vue'
  67. import { currentPickupPoint, nearbyPickupPoints } from '@/static/js/mockTeam.js'
  68. export default {
  69. components: {
  70. navbar
  71. },
  72. data() {
  73. return {
  74. // 当前取餐点
  75. currentPickupPoint:{},
  76. // 附近取餐点列表
  77. nearbyPickupPoints:[]
  78. }
  79. },
  80. methods: {
  81. // 选择取餐点
  82. selectPickupPoint(point) {
  83. uni.showModal({
  84. title: '确认选择',
  85. content: '您确定要选择该取餐点吗?需要平台审核通过后才能更换。',
  86. confirmColor: '#019245',
  87. success: (res) => {
  88. if (res.confirm) {
  89. uni.showLoading({
  90. title: '提交中...'
  91. })
  92. this.$api('deleteLeader',{
  93. leaderUpdateId: point.id
  94. }, res => {
  95. if (res.code === 200){
  96. this.updateLeader(point)
  97. }
  98. })
  99. }
  100. }
  101. })
  102. },
  103. updateLeader(point) {
  104. this.$api('updateLeader', {
  105. id: point.id
  106. }, res => {
  107. if (res.code == 200) {
  108. uni.hideLoading()
  109. uni.showToast({
  110. title: '申请已提交,等待平台审核',
  111. icon: 'success',
  112. })
  113. setTimeout(() => {
  114. this.$utils.navigateBack()
  115. }, 1000)
  116. }
  117. })
  118. }
  119. },
  120. onLoad() {
  121. this.currentPickupPoint = currentPickupPoint
  122. this.$api('queryLeaderList', {}, res => {
  123. if (res.code == 200){
  124. this.nearbyPickupPoints = res.result.records
  125. }
  126. })
  127. // this.$api('queryLeaderInfo', {}, res => {
  128. // if (res.code == 200){
  129. // this.currentPickupPoint = res.result
  130. // }
  131. // })
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .page {
  137. // background-color: #f5f5f5;
  138. // min-height: 100vh;
  139. }
  140. .section {
  141. width: 96%;
  142. margin: 0 auto;
  143. margin-bottom: 20rpx;
  144. // border-radius: 10rpx;
  145. &-title {
  146. font-size: 32rpx;
  147. font-weight: bold;
  148. color: #333;
  149. padding: 30rpx 30rpx 20rpx;
  150. }
  151. }
  152. .pickup {
  153. &-item {
  154. background-color: #fff;
  155. padding: 20rpx 20rpx;
  156. display: flex;
  157. position: relative;
  158. margin-bottom: 2rpx;
  159. border-radius: 20rpx;
  160. }
  161. &-image {
  162. width: 170rpx;
  163. height: 170rpx;
  164. margin: auto 20rpx auto 0;
  165. overflow: hidden;
  166. image {
  167. width: 100%;
  168. height: 100%;
  169. }
  170. }
  171. &-info {
  172. flex: 1;
  173. display: flex;
  174. flex-direction: column;
  175. justify-content: space-between;
  176. }
  177. &-name {
  178. font-size: 30rpx;
  179. font-weight: bold;
  180. color: #3B3B3B;
  181. margin-bottom: 10rpx;
  182. }
  183. &-address, &-phone {
  184. font-size: 26rpx;
  185. color: $uni-color-third;
  186. display: flex;
  187. align-items: center;
  188. margin-bottom: 8rpx;
  189. width: 85%;
  190. text {
  191. margin-left: 8rpx;
  192. }
  193. &-icon {
  194. height: 100%;
  195. padding-top: 20rpx;
  196. }
  197. }
  198. }
  199. .status-icon {
  200. position: absolute;
  201. right: 30rpx;
  202. top: 50%;
  203. transform: translateY(-50%);
  204. }
  205. .select-btn {
  206. background-color: $uni-color;
  207. color: #fff;
  208. width: 100rpx;
  209. height: 60rpx;
  210. display: flex;
  211. justify-content: center;
  212. align-items: center;
  213. border-radius: 10rpx;
  214. align-self: center;
  215. font-size: 24rpx;
  216. }
  217. .warning-tip {
  218. background-color: #FFDBDB;
  219. // width: 90%;
  220. margin: 0rpx 40rpx 20rpx 30rpx;
  221. border-radius: 10rpx;
  222. padding: 15rpx 15rpx;
  223. display: flex;
  224. align-items: center;
  225. margin-bottom: 20rpx;
  226. text {
  227. font-size: 26rpx;
  228. color: $uni-color-second;
  229. margin-left: 10rpx;
  230. }
  231. }
  232. .pickup-list {
  233. gap: 20rpx;
  234. .pickup-item {
  235. margin-bottom: 20rpx;
  236. }
  237. }
  238. </style>