information.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view>
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view :style="{marginTop:navH}"></view>
  6. <view class="basicInfo">
  7. <image :src="mainImg" style="width: 150rpx;height: 150rpx;" mode="">
  8. </image>
  9. <view class="basicInfo_txt">
  10. <p style="margin-bottom: 10rpx;font-size: 31rpx; font-weight: bold;">
  11. {{selection.selection_name}}
  12. </p>
  13. <p style="font-size: 27rpx;">售价:¥{{selection.YounggeeProduct[0].product_price}} &nbsp;&nbsp;&nbsp;&nbsp;
  14. 样叽高佣:{{selection.YounggeeProduct[0].exclusive_commission}}%</p>
  15. <p style="font-size: 27rpx;" v-if="selection.task_mode === 1">
  16. 额外悬赏:¥{{selection.RewardStrategy[0].per_reward}}</p>
  17. </view>
  18. </view>
  19. <view class="address">
  20. <view>
  21. <image class="address_icon" :src="picture.icon_loc" mode="">
  22. </image>
  23. </view>
  24. <view style="width: 70%;">
  25. <view style="display: flex;">
  26. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  27. <p class='ipon'>{{address.phone_number}}</p>
  28. </view>
  29. <p class='ipon'>{{address.full_detail_addr}}</p>
  30. </view>
  31. <view class="address_edit" @click="editAddress()">
  32. <image :src="picture.icon_edit" mode="">
  33. </image>
  34. </view>
  35. </view>
  36. <view class="keyInfo">
  37. <p style="margin-bottom: 30rpx;font-size: 36rpx; font-weight: bold;">任务要求</p>
  38. <!-- <p>内容形式:{{selection.show_content_type}}</p> -->
  39. <p>带货链接:{{selection.product_url}}
  40. <image :src="picture.icon_copy" mode="" class="copy-img" @click="handleCopy('123')" />
  41. </p>
  42. <p>领样要求:</p>
  43. <!-- 具体领样品要求(粉丝数量) -->
  44. <view class="markcontent">
  45. <view class="" v-for="item in selection.FreeStrategy">
  46. <p style=" margin-top: 20rpx; margin-bottom: 20rpx; font-size: 26rpx;">
  47. 粉丝量{{getFansLabel(item.fans_num)}},近30天橱窗销量≥{{item.sale_num}}单</p>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="account" @click="editAccount()">
  52. <view class="account_txt">
  53. <image :src="selection.PlatformInfo.platform_icon" mode=""></image>
  54. <span>{{account.platform_nickname}}</span>
  55. </view>
  56. <view class="account_fans">
  57. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  58. <p>{{account.show_fans_count}}</p>
  59. </view>
  60. <view class="account_btn">
  61. <image :src="picture.togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  62. </view>
  63. </view>
  64. <view class="block"></view>
  65. <view class="submit">
  66. <button type="default" class="submit_btn" @click="submit()"> 确认报名并添加橱窗</button>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. import region from '@/components/pca-code.json';
  72. import mvBar from "@/components/mys_navBar/mysNavBar";
  73. import {
  74. fansview
  75. } from '@/components/utils.js';
  76. export default {
  77. components: {
  78. mvBar
  79. },
  80. data() {
  81. return {
  82. navH: getApp().globalData.navHeight,
  83. picture: getApp().globalData.picture,
  84. mysNavConfig: {
  85. isHome: false,
  86. /* 固定导航 */
  87. navFixed: true,
  88. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  89. navTitle: {
  90. text: "信息确认",
  91. color: "",
  92. fontSize: "32rpx", // px upx rpx
  93. fontWeight: "", // 100 - 700
  94. },
  95. btnType: "type2",
  96. onLeftClick: '',
  97. /* type2 按钮 */
  98. type2Config: {
  99. // 左图标
  100. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png2.png",
  101. // 右图标
  102. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png4.png",
  103. // 圆角
  104. radius: "40rpx",
  105. },
  106. },
  107. options: [{
  108. value: '1',
  109. label: '所有人均可领取'
  110. },
  111. {
  112. value: '2',
  113. label: '1w下'
  114. },
  115. {
  116. value: '3',
  117. label: '1w-10w'
  118. },
  119. {
  120. value: '4',
  121. label: '10w-100w'
  122. },
  123. {
  124. value: '5',
  125. label: '100w-500w'
  126. },
  127. {
  128. value: '6',
  129. label: '500w-1000w'
  130. },
  131. {
  132. value: '7',
  133. label: '1000w以上'
  134. },
  135. ],
  136. selection: {},
  137. youngTeamId: "",
  138. youngLeadTeamId: "",
  139. mainImg: "https://horastar.obs.cn-east-3.myhuaweicloud.com/backstage_upload/bb531ede-28b5-49a0-8431-a1608fd35890.png",
  140. account_id: -1,
  141. address_id: -1,
  142. address: null,
  143. project: null,
  144. account: null,
  145. strategy: null,
  146. thirdPlatform: [],
  147. }
  148. },
  149. onShow() {
  150. // 根据address_id查询address
  151. this.getDefaultAddress();
  152. // 查询account
  153. this.getAccount();
  154. },
  155. onLoad(options) {
  156. this.textObj = options.textObj.replace(/""/g, "");
  157. this.textObj = JSON.parse(decodeURIComponent(this.textObj))
  158. this.selection = this.textObj.selection
  159. console.log("this.selection------>", this.selection)
  160. this.youngTeamId = this.textObj.youngTeamId
  161. this.youngLeadTeamId = this.textObj.youngLeadTeamId
  162. for (let i = 0; i < this.selection.YounggeeProductPhoto.length; ++i) {
  163. console.log("intoforloop---->", this.selection.YounggeeProductPhoto[i])
  164. if (this.selection.YounggeeProductPhoto[i].symbol === 1) {
  165. this.mainImg = this.selection.YounggeeProductPhoto[i].photo_url
  166. }
  167. }
  168. console.log("this.mainIma---->", this.mainImg)
  169. if (this.youngLeadTeamId === "") {
  170. this.getLeadYoungTeamId()
  171. }
  172. },
  173. methods: {
  174. getFansLabel(fansNum) {
  175. const option = this.options.find(o => o.value === fansNum.toString());
  176. return option ? option.label : fansNum;
  177. },
  178. handleCopy(content) {
  179. wx.setClipboardData({
  180. data: content,
  181. success: function(res) {
  182. console.log("复制成功");
  183. }
  184. });
  185. },
  186. getLeadYoungTeamId() {
  187. // 调用后端接口,创建young之团,若young之团存在则返回teamid,否则创建young之团并返回id
  188. return this.$https.post('/youngee/c/t/p/add-young-team', {
  189. selection_id: this.selection.selection_id,
  190. project_type: 2,
  191. })
  192. .then(res => {
  193. console.log(res)
  194. this.youngLeadTeamId = res.data.data;
  195. })
  196. },
  197. getAccount() {
  198. this.$https.get('/youngee/c/t/g/get-talent-account')
  199. .then(res => {
  200. console.log(res)
  201. console.log(res.data.data)
  202. if (res.data.code !== -3) {
  203. let account = res.data.data
  204. while (this.selection == null) {} // 这句很危险
  205. for (var i = 0; i < account.length; i++) {
  206. if (this.selection.platform == account[i].platform_id) {
  207. this.account = account[i]
  208. }
  209. }
  210. this.account.show_fans_count = fansview(this.account.fans_count)
  211. }
  212. })
  213. },
  214. getDefaultAddress() {
  215. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  216. console.log(res.data.data)
  217. this.address = res.data.data;
  218. let a = this.address.region_code.toString().slice(0, 2)
  219. let b = this.address.region_code.toString().slice(0, 4)
  220. let c = 0
  221. for (var i = 0; i < region.length; i++) {
  222. if (region[i].code == a) {
  223. a = region[i].name
  224. for (var j = 0; j < region[i].children.length; j++) {
  225. if (region[i].children[j].code == b) {
  226. b = region[i].children[j].name
  227. for (var o = 0; o < region[i].children[j].children.length; o++) {
  228. if (region[i].children[j].children[o].code == this.address
  229. .region_code) {
  230. c = region[i].children[j].children[o].name
  231. }
  232. }
  233. }
  234. }
  235. }
  236. }
  237. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  238. })
  239. },
  240. editAddress() {
  241. uni.navigateTo({
  242. url: '/page_mycenter/myinformation/addlocation?address_id=' + this.address.address_id +
  243. '&ismodify=1'
  244. });
  245. },
  246. editAccount() {
  247. uni.navigateTo({
  248. url: '/page_mycenter/myinformation/bindaccount?platform_id=' + this.account.platform_id +
  249. '&account_id=' +
  250. this.account.account_id
  251. });
  252. },
  253. debugSubmit() {
  254. uni.navigateTo({
  255. url: '/page_tasksquare/wholetask/success'
  256. });
  257. },
  258. // 提交确认报名
  259. async submit() {
  260. console.log("提交报名")
  261. // 直接报名
  262. console.log("********", this.selection.product_id)
  263. this.$https.post('/youngee/c/t/p/sign-up-sec-task', {
  264. address_id: this.address.address_id,
  265. selection_id: this.selection.selection_id,
  266. lead_team_id: this.youngLeadTeamId,
  267. team_id: this.youngTeamId,
  268. product_id: this.selection.product_id
  269. }).then(res => {
  270. if (res.data.code == 0) {
  271. var data = {
  272. task_id: res.data.data.task_id
  273. };
  274. data = JSON.stringify(data)
  275. uni.navigateTo({
  276. url: '/page_selectionsquare/selectiondetail/success?textObj=' +
  277. encodeURIComponent(
  278. data)
  279. });
  280. } else {
  281. uni.showModal({
  282. content: '网络繁忙,请小主稍后再试~',
  283. });
  284. }
  285. })
  286. }
  287. },
  288. }
  289. </script>
  290. <style lang="scss" scoped>
  291. text {
  292. font-size: 32rpx;
  293. }
  294. p {
  295. font-size: 32rpx;
  296. }
  297. .basicInfo {
  298. display: flex;
  299. margin: 0 40rpx;
  300. padding: 30rpx 0;
  301. .basicInfo_txt {
  302. margin-left: 40rpx;
  303. padding-top: 20rpx;
  304. }
  305. }
  306. .address {
  307. display: flex;
  308. margin: 30rpx 40rpx 0;
  309. padding: 30rpx 0;
  310. justify-content: space-around;
  311. .address_icon {
  312. vertical-align: middle;
  313. width: 50rpx;
  314. height: 50rpx;
  315. display: inline-block;
  316. padding-right: 30rpx;
  317. }
  318. .address_edit {}
  319. .address_edit image {
  320. vertical-align: middle;
  321. width: 50rpx;
  322. height: 50rpx;
  323. display: inline-block;
  324. padding-right: 14rpx;
  325. }
  326. .ipon {
  327. color: #333333;
  328. font-size: 30rpx;
  329. margin-bottom: 10rpx;
  330. }
  331. }
  332. .keyInfo {
  333. margin: 30rpx 40rpx;
  334. }
  335. .keyInfo span {
  336. display: flex;
  337. align-items: center;
  338. margin: 10rpx 0;
  339. }
  340. .keyInfo p {
  341. margin: 25rpx 0;
  342. }
  343. .account {
  344. display: flex;
  345. align-items: center;
  346. width: 690rpx;
  347. padding: 24rpx 0;
  348. margin: 0 auto;
  349. .account_txt {
  350. display: inline-block;
  351. padding: 0 0 0 1%;
  352. width: 400rpx;
  353. }
  354. .account_txt span {
  355. color: #333333;
  356. font-weight: 550;
  357. text-indent: 2em;
  358. font-size: 32rpx;
  359. }
  360. .account_txt image {
  361. vertical-align: middle;
  362. width: 50rpx;
  363. height: 50rpx;
  364. display: inline-block;
  365. padding-right: 14rpx;
  366. }
  367. .account_fans {
  368. display: flex;
  369. width: 250rpx;
  370. }
  371. .account_fans p {
  372. display: inline-block;
  373. color: #333333;
  374. font-weight: 550;
  375. }
  376. .account_btn {}
  377. }
  378. .block {
  379. width: 100%;
  380. height: 100rpx;
  381. margin-top: 5%;
  382. }
  383. .submit {
  384. box-shadow: 0rpx 5rpx 40rpx #ccc;
  385. width: 100%;
  386. position: fixed;
  387. bottom: 0rpx;
  388. display: flex;
  389. height: 90rpx;
  390. padding-top: 2%;
  391. background-color: #FFFFFF;
  392. .submit_btn {
  393. background-color: #FCCF41;
  394. border-radius: 20rpx;
  395. font-size: 30rpx;
  396. line-height: 220%;
  397. letter-spacing: 5rpx;
  398. height: 80%;
  399. }
  400. }
  401. </style>