editOutbound.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <view class="container outbound-content">
  3. <!-- 这里顶部安全是状态栏 -->
  4. <view class="status_bar" color="#000000" :style="'height:' + demoTop + 'px;'"> </view>
  5. <!-- 自定义状态栏 -->
  6. <view class="status_title">
  7. <u-icon name="arrow-left" size="38" @click="backArrowleft"></u-icon>
  8. <view class="status_center">{{ isShowTitle }}</view>
  9. </view>
  10. <!-- 文本提示 -->
  11. <view class="top-box" v-if="isShowTitle == '修改外呼号码' || identification == '邮箱'"> 修改后的外呼号码,将作为您的默认外呼号码,若后期还需修改,可在【我的】-【外呼号码】页面设置 </view>
  12. <!-- 输入外呼手机号 -->
  13. <view class="item-box">
  14. <view class="ipt-item">
  15. <label class="item-label item-iphone" @click="areaCode">+{{ telephone }} <u-icon :name="areacodeShow ? 'arrow-up' : 'arrow-down'" color="#3385FF" size="28"></u-icon></label>
  16. <input type="text" v-model="phoneIpt" class="ipt" placeholder="请输入外呼号码" />
  17. </view>
  18. <text class="text-box">座机号请填写区号,分机号用"-"分隔,例:02150509999-8888</text>
  19. </view>
  20. <!-- 底部确认 和取消 -->
  21. <view class="bottom-btn">
  22. <view class="submit-box" @click="submit"> 提交 </view>
  23. <view class="cancel" v-if="isShowTitle !== '设置外呼号码'" @click="cancelModification"> 取消修改 </view>
  24. </view>
  25. <!-- 选择区号部分 -->
  26. <view class="select-box">
  27. <u-popup v-model="areacodeShow" mode="bottom" @close="areacodeShow = false">
  28. <view class="box" style="color: #333333; font-size: 28rpxrpx">请选择您的国际区号</view>
  29. <view class="box" style="color: #2c83ff" @click="areacode('86')">大陆+86</view>
  30. <view class="box" style="color: #2c83ff" @click="areacode('852')">香港+852</view>
  31. <view class="box" style="color: #2c83ff" @click="areacode('886')">台湾+886</view>
  32. <view class="box" style="color: #2c83ff" @click="areacode('1')">美国+1</view>
  33. <view class="box" style="color: #2c83ff" @click="areacode('65')">新加坡+65</view>
  34. <view class="box box-bottom" style="color: #a9afb8" @click="areacodeShow = false">取消</view>
  35. </u-popup>
  36. </view>
  37. <!-- 关注公众号 弹框 -->
  38. <u-modal
  39. v-model="goFollowShow"
  40. :content-style="{ fontSize: '32rpx' }"
  41. @confirm="goFollowShowBtn"
  42. :show-cancel-button="true"
  43. confirm-text="去关注"
  44. @cancel="cancelDialog"
  45. :show-title="false"
  46. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  47. :confirm-style="{ fontWeight: '700' }"
  48. >
  49. <view class="slot-content">
  50. <rich-text :nodes="accounts"></rich-text>
  51. </view>
  52. </u-modal>
  53. <!-- 知道的弹框 -->
  54. <u-modal v-model="show" :content="content" :content-style="{ fontSize: '32rpx' }" @confirm="cancelDialog" :show-title="false" confirm-text="知道了" :confirm-style="{ fontWeight: '700' }">
  55. <view class="slot-content">
  56. <rich-text :nodes="content"></rich-text>
  57. </view>
  58. </u-modal>
  59. </view>
  60. </template>
  61. <script>
  62. import { activity } from "@/config/api.js";
  63. export default {
  64. data() {
  65. return {
  66. phoneIpt: "",
  67. isShowTitle: "设置",
  68. telephone: "86",
  69. areacodeShow: false,
  70. identification: "",
  71. goFollowShow: false,
  72. accounts: "",
  73. show: false,
  74. content: "",
  75. demoTop: "",
  76. id: "",
  77. goOnNextStep: "",
  78. cellphone: "",
  79. };
  80. },
  81. methods: {
  82. areaCode() {
  83. this.areacodeShow = true;
  84. },
  85. areacode(code) {
  86. this.telephone = code;
  87. this.areacodeShow = false;
  88. },
  89. //提交
  90. submit() {
  91. activity
  92. .addOutboundMobile({
  93. ActivityId: Number(this.id),
  94. OutboundCountryCode: this.telephone,
  95. OutboundMobile: this.phoneIpt,
  96. })
  97. .then((res) => {
  98. if (res.Ret !== 200) return;
  99. if (this.identification == "修改" || this.identification == "邮箱") {
  100. if (this.identification == "邮箱") {
  101. let pages = getCurrentPages();
  102. let prevPage = pages[pages.length - 2];
  103. if (prevPage.$page.fullPath == "/pages/activity/activity" || prevPage.$page.fullPath == "/activityPages/activitySearch/activitySearch") {
  104. const index = prevPage.$vm.collectList.findIndex((item) => item.ActivityId == this.id);
  105. prevPage.$vm.collectList[index].IsSignup = 1;
  106. }
  107. }
  108. if (this.goOnNextStep == "true") {
  109. this.accounts = `
  110. ${this.telephone}-${this.phoneIpt}<br/>
  111. 预约成功,已加入您的活动日程<br/><br/>
  112. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  113. `;
  114. this.goFollowShow = true;
  115. } else {
  116. this.content = `
  117. ${this.telephone}-${this.phoneIpt}<br/><br/>
  118. 预约外呼成功,已加入您的活动日程
  119. `;
  120. this.show = true;
  121. }
  122. } else {
  123. uni.navigateBack();
  124. }
  125. });
  126. },
  127. //取消修改
  128. cancelModification() {
  129. if (this.identification == "修改") {
  130. if (this.goOnNextStep == "true") {
  131. this.accounts = `
  132. ${this.cellphone}<br/>
  133. 预约成功,已加入您的活动日程<br/><br/>
  134. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  135. `;
  136. this.goFollowShow = true;
  137. } else {
  138. this.content = `
  139. ${this.cellphone}<br/><br/>
  140. 预约外呼成功,已加入您的活动日程
  141. `;
  142. this.show = true;
  143. }
  144. } else {
  145. uni.navigateBack();
  146. }
  147. },
  148. //去关注公众号
  149. goFollowShowBtn() {
  150. uni.redirectTo({
  151. url: "/activityPages/accountsOfficial/accountsOfficial",
  152. });
  153. },
  154. //弹框的取消
  155. cancelDialog() {
  156. uni.navigateBack();
  157. },
  158. //右上角的返回
  159. backArrowleft() {
  160. if (this.identification == "修改") {
  161. if (this.goOnNextStep == "true") {
  162. this.accounts = `
  163. ${this.cellphone}<br/>
  164. 预约成功,已加入您的活动日程<br/><br/>
  165. 想要及时获取活动时间变更通知,请关注【查研观向小助手】公众号
  166. `;
  167. this.goFollowShow = true;
  168. } else {
  169. this.content = `
  170. ${this.cellphone}<br/><br/>
  171. 预约外呼成功,已加入您的活动日程
  172. `;
  173. this.show = true;
  174. }
  175. } else {
  176. uni.navigateBack();
  177. }
  178. },
  179. },
  180. onLoad(option) {
  181. this.isShowTitle = option.title;
  182. this.identification = option.identification;
  183. this.id = option.id || "";
  184. this.goOnNextStep = option.goOnNextStep || "";
  185. this.cellphone = option.cellphone || "";
  186. const res = uni.getSystemInfoSync();
  187. this.demoTop = res.safeArea.top;
  188. },
  189. };
  190. </script>
  191. <style scoped lang="scss">
  192. .outbound-content {
  193. /* 自定义状态栏 */
  194. .status_bar {
  195. width: 100%;
  196. }
  197. /* 自定义导航栏 */
  198. .status_title {
  199. box-sizing: border-box;
  200. display: flex;
  201. align-items: center;
  202. width: 100%;
  203. height: 88rpx;
  204. padding: 10rpx 62rpx 15rpx 30rpx;
  205. background-color: #ffffff;
  206. box-sizing: border-box;
  207. }
  208. .status_center {
  209. margin: 0 auto;
  210. font-size: 34rpx;
  211. font-weight: 400;
  212. color: #000000;
  213. }
  214. .top-box {
  215. width: 100%;
  216. background-color: #f7f7f7;
  217. padding: 20rpx 34rpx;
  218. font-size: 28rpx;
  219. font-weight: 400;
  220. line-height: 48rpx;
  221. color: #666666;
  222. }
  223. .item-box {
  224. width: 100%;
  225. margin-top: 35rpx;
  226. padding: 0 32rpx;
  227. .text-box {
  228. height: 30rpx;
  229. font-size: 22rpx;
  230. line-height: 30px;
  231. color: #999999;
  232. }
  233. }
  234. .ipt-item {
  235. padding: 33rpx 0 10rpx;
  236. border-bottom: 1rpx solid #d6d6d6;
  237. display: flex;
  238. align-items: center;
  239. font-size: 28rpx;
  240. .item-label {
  241. display: flex;
  242. justify-content: space-between;
  243. width: 105rpx;
  244. color: #3385ff;
  245. }
  246. .ipt {
  247. margin-left: 40rpx;
  248. width: 500rpx;
  249. font-size: 32rpx;
  250. color: #666;
  251. }
  252. }
  253. .bottom-btn {
  254. margin-top: 247rpx;
  255. font-size: 34rpx;
  256. text-align: center;
  257. .submit-box {
  258. margin: 0 auto;
  259. width: 368rpx;
  260. height: 80rpx;
  261. background: linear-gradient(268deg, #2ddbff 0%, #1599ff 49%, #005eff 100%);
  262. color: #ffffff;
  263. line-height: 80rpx;
  264. border-radius: 4rpx;
  265. }
  266. .cancel {
  267. margin: 30rpx auto;
  268. width: 368rpx;
  269. height: 80rpx;
  270. border: 2px solid #2c83ff;
  271. border-radius: 4rpx;
  272. line-height: 80rpx;
  273. color: #2c83ff;
  274. }
  275. }
  276. .select-box {
  277. width: 100%;
  278. .box {
  279. height: 95prx;
  280. line-height: 95rpx;
  281. text-align: center;
  282. font-size: 32rpx;
  283. border-bottom: 1rpx solid #ebebeb;
  284. }
  285. .box-bottom {
  286. border-bottom: none !important;
  287. }
  288. }
  289. }
  290. .slot-content {
  291. width: 100%;
  292. padding: 50rpx;
  293. text-align: center;
  294. font-size: 32rpx;
  295. color: #0f1826;
  296. line-height: 48rpx;
  297. }
  298. .u-model__footer__button.data-v-3626fcec {
  299. border-right: 1rpx solid #333;
  300. }
  301. </style>