information.vue 11 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: 36rpx;">{{project.project_name}}</p>
  11. <p>商品价值:{{project.Product.ProductPrice}}元</p>
  12. </view>
  13. </view>
  14. <view class="address">
  15. <view>
  16. <image class="address_icon" :src="picture.icon_loc" mode="">
  17. </image>
  18. </view>
  19. <view style="width: 70%;">
  20. <view style="display: flex;">
  21. <p class='ipon' style="padding-right: 100rpx;">{{address.receiver_name}}</p>
  22. <p class='ipon'>{{address.phone_number}}</p>
  23. </view>
  24. <p class='ipon'>{{address.full_detail_addr}}</p>
  25. </view>
  26. <view class="address_edit" @click="editAddress()">
  27. <image :src="picture.icon_edit" mode="">
  28. </image>
  29. </view>
  30. </view>
  31. <view class="keyInfo">
  32. <!-- <p style="margin-bottom: 30rpx;font-size: 36rpx;">关键任务信息</p> -->
  33. <p style="margin-top: 10rpx;">合作佣金</p>
  34. <view style="padding-top: 10rpx;">
  35. <p>粉丝量:{{strategy.show_followers_low}}-{{strategy.show_followers_up}}
  36. </p>
  37. </view>
  38. <view style="display: flex;">
  39. <p>
  40. 稿费:{{strategy.fee_form_t}}
  41. </p>
  42. <view v-if="strategy.fee_form==3">
  43. <p>{{strategy.showOffer}}元</p>
  44. </view>
  45. </view>
  46. <!-- <view style="border-bottom: #dfdfdf 1px solid;margin: 10rpx 0 0;"></view>
  47. <p style="margin-top: 10rpx;">社媒平台</p>
  48. <view style="display: flex;padding-top: 10rpx;">
  49. <p>{{project.PlatformInfo.platform_name}}</p>
  50. </view>
  51. <view style="border-bottom: #dfdfdf 1px solid;margin: 10rpx 0 0;"></view>
  52. <p style="margin-top: 10rpx;">任务要求</p>
  53. <view class="keyInfo_task">
  54. <view style="display: flex;align-items: center;margin: 5rpx 0;">
  55. <p>内容形式:</p>
  56. <p class="keyInfo_task_txt">{{project.content}}</p>
  57. </view>
  58. <view style="display: flex;align-items: center;margin: 5rpx 0;">
  59. <p>任务形式:</p>
  60. <p class="keyInfo_task_txt">{{project.project_form}}</p>
  61. </view>
  62. <p style="margin: 5rpx 0;">商品描述:</p>
  63. <text class="keyInfo_task_txt">{{project.Product.ProductDetail}}</text>
  64. <p style="margin: 35rpx 0 0rpx;">任务详情:</p>
  65. <text class="keyInfo_task_txt">{{project.project_detail}}</text>
  66. </view> -->
  67. </view>
  68. <view class="account" @click="editAccount()">
  69. <view class="account_txt">
  70. <image :src="project.PlatformInfo.platform_icon" mode=""></image>
  71. <span>{{account.platform_nickname}}</span>
  72. </view>
  73. <view class="account_fans">
  74. <p style="padding-right: 20rpx;color:#A8A8A8;">粉丝数</p>
  75. <p>{{account.show_fans_count}}</p>
  76. </view>
  77. <view class="account_btn">
  78. <image :src="picture.togoimg" mode="" style="width: 16rpx;height: 30rpx;"></image>
  79. </view>
  80. </view>
  81. <view class="block"></view>
  82. <view class="submit">
  83. <button type="default" class="submit_btn" @click="submit()"> 确认报名</button>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import region from '@/components/pca-code.json';
  89. import mvBar from "@/components/mys_navBar/mysNavBar";
  90. import {
  91. fansview
  92. } from '@/components/utils.js';
  93. export default {
  94. components: {
  95. mvBar
  96. },
  97. data() {
  98. return {
  99. navH: getApp().globalData.navHeight,
  100. picture: getApp().globalData.picture,
  101. mainImg: "https://horastar.obs.cn-east-3.myhuaweicloud.com/backstage_upload/bb531ede-28b5-49a0-8431-a1608fd35890.png",
  102. account_id: -1,
  103. address_id: -1,
  104. address: null,
  105. project: null,
  106. account: null,
  107. strategy: null,
  108. thirdPlatform: [],
  109. mysNavConfig: {
  110. isHome: false,
  111. /* 固定导航 */
  112. navFixed: true,
  113. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  114. navTitle: {
  115. text: "信息确认",
  116. color: "",
  117. fontSize: "32rpx", // px upx rpx
  118. fontWeight: "", // 100 - 700
  119. },
  120. btnType: "type2",
  121. onLeftClick: '',
  122. /* type2 按钮 */
  123. type2Config: {
  124. // 左图标
  125. leftPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png2.png",
  126. // 右图标
  127. rightPath: "https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/png4.png",
  128. // 圆角
  129. radius: "40rpx",
  130. },
  131. },
  132. }
  133. },
  134. onShow() {
  135. // 根据address_id查询address
  136. this.getDefaultAddress();
  137. // 查询account
  138. this.getAccount();
  139. },
  140. onLoad(options) {
  141. this.textObj = options.textObj.replace(/""/g, "");
  142. this.textObj = JSON.parse(decodeURIComponent(this.textObj))
  143. console.log(this.textObj)
  144. this.project = this.textObj.information
  145. this.strategy = this.textObj.strategy
  146. // console.log(this.project)
  147. for (let i = 0; i < this.project.Product.ProductPhoto.length; ++i) {
  148. if (this.project.Product.ProductPhoto[i].Symbol === 1) {
  149. this.mainImg = this.project.Product.ProductPhoto[i].PhotoUrl
  150. }
  151. }
  152. this.strategy.show_followers_low = fansview(this.strategy.followers_low)
  153. this.strategy.show_followers_up = fansview(this.strategy.followers_up)
  154. },
  155. methods: {
  156. getAccount() {
  157. this.$https.get('/youngee/c/t/g/get-talent-account')
  158. .then(res => {
  159. console.log(res)
  160. if (res.data.code !== -3) {
  161. let account = res.data.data
  162. while (this.project == null) {}
  163. for (var i = 0; i < account.length; i++) {
  164. if (this.project.project_platform == account[i].platform_id) {
  165. this.account = account[i]
  166. }
  167. }
  168. this.account.show_fans_count = fansview(this.account.fans_count)
  169. }
  170. })
  171. },
  172. getDefaultAddress() {
  173. this.$https.get('/youngee/c/t/g/get-talent-default-address').then(res => {
  174. console.log(res.data.data)
  175. this.address = res.data.data;
  176. let a = this.address.region_code.toString().slice(0, 2)
  177. let b = this.address.region_code.toString().slice(0, 4)
  178. let c = 0
  179. for (var i = 0; i < region.length; i++) {
  180. if (region[i].code == a) {
  181. a = region[i].name
  182. for (var j = 0; j < region[i].children.length; j++) {
  183. if (region[i].children[j].code == b) {
  184. b = region[i].children[j].name
  185. for (var o = 0; o < region[i].children[j].children.length; o++) {
  186. if (region[i].children[j].children[o].code == this.address
  187. .region_code) {
  188. c = region[i].children[j].children[o].name
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }
  195. this.address.full_detail_addr = a + b + c + this.address.detail_addr
  196. })
  197. },
  198. editAddress() {
  199. uni.navigateTo({
  200. url: '/page_mycenter/myinformation/addlocation?address_id=' + this.address.address_id +
  201. '&ismodify=1'
  202. });
  203. },
  204. editAccount() {
  205. uni.navigateTo({
  206. url: '/page_mycenter/myinformation/bindaccount?platform_id=' + this.account.platform_id +
  207. '&account_id=' +
  208. this.account.account_id
  209. });
  210. },
  211. debugSubmit() {
  212. uni.navigateTo({
  213. url: '/page_tasksquare/wholetask/success'
  214. });
  215. },
  216. // 提交确认报名
  217. submit() {
  218. console.log(this.project)
  219. // 1. 判断任务是否截止
  220. this.$https.get('/youngee/c/t/g/get-project-detail' +
  221. "?" +
  222. "projectid" +
  223. "=" +
  224. this.project.project_id
  225. ).then(res => {
  226. console.log(res)
  227. // 当前时间
  228. var newdate = new Date()
  229. // 截止时间
  230. var endTime = new Date(res.data.data.recruit_ddl.replace(/-/g, "/"));
  231. console.log(endTime)
  232. if (endTime - newdate < 0) {
  233. // 招募截止
  234. uni.showToast({
  235. title: "任务已结束",
  236. duration: 1000,
  237. });
  238. uni.navigateTo({
  239. url: '/pages/tasksquare/tasksquare'
  240. });
  241. }
  242. })
  243. // 2. 判断粉丝量是否符合条件
  244. if (this.account.fans_count < this.strategy.followers_low) {
  245. // 招募截止
  246. uni.showToast({
  247. title: "粉丝量不达标",
  248. duration: 1000,
  249. });
  250. } else {
  251. // 3. 插入一条任务
  252. this.$https.post('/youngee/c/t/p/sign-up-task', {
  253. address_id: this.address.address_id,
  254. project_id: this.project.project_id,
  255. strategy_id: this.strategy.strategy_id,
  256. offer: this.strategy.offer,
  257. }).then(res => {
  258. if (res.data.code == 0) {
  259. var data = {
  260. task_id: res.data.data
  261. };
  262. data = JSON.stringify(data)
  263. uni.navigateTo({
  264. url: '/page_tasksquare/wholetask/success?textObj=' + encodeURIComponent(data)
  265. });
  266. } else {
  267. uni.showModal({
  268. content: '网络繁忙,请小主稍后再试~',
  269. });
  270. }
  271. })
  272. }
  273. },
  274. // 信息表
  275. getInfoList() {
  276. this.$http.get('/youngee/c/g/get-info-tables')
  277. .then(res => {
  278. this.hobby = []
  279. console.log(res)
  280. this.thirdPlatform = res.data.data.ThirdPlatform
  281. for (var i = 0; i < this.listsrc.length; i++) {
  282. var obj = {}
  283. obj.text = this.listsrc[i].platform_name
  284. obj.value = this.listsrc[i].id
  285. this.hobby.push(obj)
  286. }
  287. })
  288. },
  289. }
  290. }
  291. </script>
  292. <style lang="scss" scoped>
  293. text {
  294. font-size: 32rpx;
  295. }
  296. p{
  297. font-size: 32rpx;
  298. }
  299. .basicInfo {
  300. display: flex;
  301. margin: 0 40rpx;
  302. padding: 30rpx 0;
  303. .basicInfo_txt {
  304. margin-left: 40rpx;
  305. padding-top: 20rpx;
  306. }
  307. }
  308. .address {
  309. display: flex;
  310. margin: 30rpx 40rpx 0;
  311. padding: 30rpx 0;
  312. justify-content: space-around;
  313. .address_icon {
  314. vertical-align: middle;
  315. width: 50rpx;
  316. height: 50rpx;
  317. display: inline-block;
  318. padding-right: 30rpx;
  319. }
  320. .address_edit {}
  321. .address_edit image {
  322. vertical-align: middle;
  323. width: 50rpx;
  324. height: 50rpx;
  325. display: inline-block;
  326. padding-right: 14rpx;
  327. }
  328. .ipon {
  329. color: #333333;
  330. font-size: 32rpx;
  331. margin-bottom: 10rpx;
  332. }
  333. }
  334. .keyInfo {
  335. margin: 30rpx 40rpx;
  336. .keyInfo_task {
  337. color: #000;
  338. .keyInfo_task_txt {
  339. border-radius: 10rpx;
  340. }
  341. }
  342. }
  343. .keyInfo h3 {}
  344. .account {
  345. display: flex;
  346. align-items: center;
  347. width: 690rpx;
  348. padding: 24rpx 0;
  349. margin: 0 auto;
  350. .account_txt {
  351. display: inline-block;
  352. padding: 0 0 0 1%;
  353. width: 400rpx;
  354. }
  355. .account_txt span {
  356. color: #333333;
  357. font-weight: 550;
  358. text-indent: 2em;
  359. font-size: 32rpx;
  360. }
  361. .account_txt image {
  362. vertical-align: middle;
  363. width: 50rpx;
  364. height: 50rpx;
  365. display: inline-block;
  366. padding-right: 14rpx;
  367. }
  368. .account_fans {
  369. display: flex;
  370. width: 250rpx;
  371. }
  372. .account_fans p {
  373. display: inline-block;
  374. color: #333333;
  375. font-weight: 550;
  376. }
  377. .account_btn {}
  378. }
  379. .block {
  380. width: 100%;
  381. height: 100rpx;
  382. margin-top: 5%;
  383. }
  384. .submit {
  385. box-shadow: 0rpx 5rpx 40rpx #ccc;
  386. width: 100%;
  387. position: fixed;
  388. bottom: 0rpx;
  389. display: flex;
  390. height: 90rpx;
  391. padding-top: 2%;
  392. background-color: #FFFFFF;
  393. .submit_btn {
  394. width: 60%;
  395. background-color: #FCCF41;
  396. border-radius: 20rpx;
  397. font-size: 36rpx;
  398. line-height: 200%;
  399. letter-spacing: 10rpx;
  400. height: 80%;
  401. }
  402. }
  403. </style>