公众号项目
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.

300 lines
7.2 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <template>
  2. <view>
  3. <view class="home-pages">
  4. <view style="position: absolute;top: 0; left: 0; height: 188rpx; width: 100%; z-index: 100; background-color: #FFFFFF; box-shadow: 0px 15px 10px -15px #E8E8E8;">
  5. <view style="margin: 28rpx 24rpx; display: flex;" @click="newDetail()">
  6. <image :showLoading="true" :src="userInfo?userInfo.headImage : morenSrc" style="width: 148rpx;height: 148rpx;border-radius: 50%;"></image>
  7. <view style="padding: 28rpx;">
  8. <view style="font-size: 32rpx;font-weight: 600">{{userInfo?userInfo.nickName: '点击登录'}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="home-content">
  13. <view class="pay-btn-2" @click="seeDetail()">
  14. 刊物介绍
  15. </view>
  16. <view style="margin: 10rpx; font-weight: 200;">
  17. <span >订阅申请</span>
  18. </view>
  19. <view class="from">
  20. <view class="from-line">
  21. <span class="label-class">姓名:</span>
  22. <view><input v-model="release.name" placeholder="请输入学生姓名"/></view>
  23. </view>
  24. <view class="from-line">
  25. <span class="label-class">电话:</span>
  26. <view><input v-model="release.address" placeholder="请输入手机号码"/></view>
  27. </view>
  28. <view class="from-line">
  29. <span class="label-class">地区:</span>
  30. <view class="uni-list-cell-left">
  31. <picker @change="selectedVs" @columnchange="selectedVs" mode="multiSelector" :range="vsc">
  32. <input v-model="release.vsClass" placeholder="请选择地区"/>
  33. </picker>
  34. </view>
  35. </view>
  36. <view class="from-line">
  37. <span class="label-class">学历:</span>
  38. <view class="uni-list-cell-left">
  39. <picker @change="selectedXl" :range="xls">
  40. <input v-model="release.xl" placeholder="请选择学历"/>
  41. </picker>
  42. </view>
  43. </view>
  44. <view class="from-line">
  45. <span class="label-class">学校:</span>
  46. <view><input v-model="release.unit" placeholder="请选择学校"/></view>
  47. </view>
  48. <view class="from-line">
  49. <span class="label-class">年级:</span>
  50. <view><input v-model="release.unit" placeholder="请选择年级"/></view>
  51. </view>
  52. <view class="from-line">
  53. <span class="label-class">班级:</span>
  54. <view><input v-model="release.unit" placeholder="请选择班级"/></view>
  55. </view>
  56. <view class="home-modal" v-show="showj">
  57. <view class="title">订阅项目</view>
  58. <view @click='clickLable(0)' class="label-class" :class="{'active': release.topid === 0}"> 43.88 语文 </view>
  59. <view @click='clickLable(1)' class="label-class" :class="{'active': release.topid === 1}"> 43.88 数学 </view>
  60. <view @click='clickLable(2)' class="label-class" :class="{'active': release.topid === 2}"> 43.88 英语 </view>
  61. <view @click='clickLable(3)' class="label-class" :class="{'active': release.topid === 3}"> 43.88 化学 </view>
  62. <view @click='clickLable(4)' class="label-class" :class="{'active': release.topid === 4}"> 43.88 物理 </view>
  63. <view @click='clickLable(5)' class="label-class" :class="{'active': release.topid === 5}"> 43.88 历史 </view>
  64. </view>
  65. </view>
  66. <view class="pay-btn" @click="fabujianzhi()">
  67. 提交申请
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. export default{
  75. data(){
  76. return{
  77. isChecked:false,
  78. morenSrc:require('@/static/img/logon-icon.png'),
  79. userInfo:null,
  80. showj: false,
  81. xls: ['小学','初中','高中'],
  82. vsc: [['广东省','湖南省'], ['怀山区','广州区']],
  83. release:{
  84. name:"",
  85. address:"",
  86. vsClass:"",
  87. money:"",
  88. unit:"",
  89. startTime:"",
  90. endTime:"",
  91. phone:"",
  92. wx:"",
  93. myValue:"",
  94. xl:"",
  95. topid: ""
  96. }
  97. }
  98. },
  99. onShow() {
  100. },
  101. onLoad() {
  102. },
  103. onReady() {
  104. this.$com.displayNav()
  105. },
  106. methods:{
  107. checkboxChange(e) {
  108. let values = e.detail.value;
  109. if (values[0] == 1) {
  110. this.isChecked = true;
  111. } else {
  112. this.isChecked = false;
  113. }
  114. },
  115. getmyInfo(){
  116. this.$api('myInfo')
  117. .then(res=>{
  118. if(res.code == 200){
  119. this.role = res.result.role;
  120. this.userInfo = res.result;
  121. this.$store.commit('set_userInfo',res.result)
  122. }else{
  123. this.userInfo = null
  124. }
  125. })
  126. },
  127. //跳转刊物介绍
  128. seeDetail(){
  129. uni.navigateTo({
  130. url:`/pages/my/kanwus`
  131. })
  132. },
  133. //跳转订阅记录
  134. newDetail(){
  135. uni.navigateTo({
  136. url:`/pages/my/orders`
  137. })
  138. },
  139. lower(){
  140. },
  141. selectedXl(event){
  142. if(event.detail.value){
  143. this.release.xl = this.xls[event.detail.value]
  144. if(this.release.xl === '高中'){
  145. this.showj = true
  146. }
  147. }
  148. },
  149. selectedVs(event){
  150. if(event.type === 'columnchange'){
  151. if(event.detail.column === 0){
  152. const value = this.vsc[event.detail.column][event.detail.value];
  153. console.log("选中:" + value);
  154. if(1 === event.detail.value){
  155. this.vsc[1] = ["永州教育区","长沙教育区"]
  156. }
  157. }
  158. } else {
  159. if(event.detail){
  160. this.release.vsClass = ""
  161. event.detail.value.forEach((v,k) => {
  162. this.release.vsClass += (this.vsc[k][v] + " ");
  163. })
  164. }
  165. }
  166. },
  167. clickLable(id){
  168. this.release.topid = id
  169. }
  170. }
  171. }
  172. </script>
  173. <style lang="scss" scoped>
  174. .home-content {
  175. .from {
  176. margin-top: 20rpx;
  177. background-color: #F7F7F7;
  178. }
  179. .from-line {
  180. height: 108rpx;
  181. display: flex;
  182. background-color: #FFFFFF;
  183. .label-class{
  184. text-align: justify;
  185. text-align-last: justify;
  186. line-height: 68rpx;
  187. width: 88rpx;
  188. padding: 0 24rpx;
  189. }
  190. input{
  191. padding-left: 10rpx;
  192. height: 68rpx;
  193. }
  194. }
  195. .from-line-box {
  196. background-color: #FFFFFF;
  197. height: 328rpx;
  198. margin-right: 50rpx;
  199. display: flex;
  200. .label-class{
  201. text-align: justify;
  202. text-align-last: justify;
  203. line-height: 128rpx;
  204. width: 128rpx;
  205. padding: 0 24rpx;
  206. }
  207. input{
  208. padding-left: 20rpx;
  209. }
  210. }
  211. .pay-btn{
  212. text-align: center;
  213. border-radius: 12rpx;
  214. line-height: 78rpx;
  215. background-color: #00CCCC;
  216. color: #FFFFFF;
  217. }
  218. .pay-btn-2{
  219. margin:10rpx auto;
  220. text-align: center;
  221. border-radius: 12rpx;
  222. height: 78rpx;
  223. line-height: 78rpx;
  224. font-size: 48;
  225. background-color: #FFFFFF;
  226. }
  227. }
  228. .home-pages {
  229. padding: 188rpx 10rpx 0;
  230. background-color: #F7F7F7;
  231. .scroll-Y {
  232. height: calc(100vh - 200rpx);
  233. padding-top: 20rpx;
  234. }
  235. }
  236. .home-modal {
  237. width: 100vw;
  238. min-height: 20vh;
  239. .title {
  240. line-height: 100rpx;
  241. margin-top: 40rpx;
  242. background-color: #FFF;
  243. }
  244. .label-class {
  245. line-height: 100rpx;
  246. padding: 0 26rpx;
  247. background-color: #FFF;
  248. position: relative;
  249. }
  250. .label-class::after {
  251. content: " ";
  252. width: 30rpx;
  253. height: 30rpx;
  254. border-radius: 50%;
  255. border: 1rpx solid #888;
  256. position: absolute;
  257. right: 36rpx;
  258. top: calc((100rpx - 32rpx) / 2);
  259. }
  260. .label-class.active::after {
  261. background-color: #544AFF;
  262. border-color: #544AFF;
  263. }
  264. .label-class.active::before {
  265. background-color: #FFF;
  266. border: none;
  267. content: ' ';
  268. width: 12rpx;
  269. height: 12rpx;
  270. border-radius: 50%;
  271. z-index: 1;
  272. position: absolute;
  273. top: calc((100rpx - 12rpx) / 2);
  274. right: 46rpx;
  275. }
  276. }
  277. </style>